Uh oh!
There was an error while loading. Please reload this page.
[SPARK-12476][SQL] Implement JdbcRelation#unhandledFilters for removing unnecessary Spark Filter - #10427
[SPARK-12476][SQL] Implement JdbcRelation#unhandledFilters for removing unnecessary Spark Filter#10427maropu wants to merge 12 commits into
Conversation
SparkQA
commented
Dec 22, 2015
Test build #48159 has finished for PR 10427 at commit
|
maropu
commented
Dec 22, 2015
BTW, a role of |
SparkQA
commented
Dec 22, 2015
Test build #48161 has finished for PR 10427 at commit
|
There was a problem hiding this comment.
Should we maybe add some comments or messages to know what this assert mean?
HyukjinKwon
commented
Dec 22, 2015
9ead74a to
a910a7eCompareThere was a problem hiding this comment.
A nit. Please wrap with [[]] Scala classes (SparkPlan, Filterand JDBCRelation) in comments.
There was a problem hiding this comment.
Actually you don't need to do so. [[...]] notation is only used in ScalaDoc for adding links. It's not effective in inline comments.
There was a problem hiding this comment.
We need the wrap for scaladoc though, we also need it just for comments?
There are the comments that have no wrap for spark classes;
https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala#L558
There was a problem hiding this comment.
Yeah, that's what I mean. Double brackets are not required for inline comments (i.e., here).
There was a problem hiding this comment.
I see. Thanks! That was my bad.
HyukjinKwon
commented
Dec 22, 2015
@liancheng would you tell me what you think on this? I made some commits locally and want to be sure and make them structurally consistent with this PR becore creating new PRs for them. |
SparkQA
commented
Dec 22, 2015
Test build #48188 has finished for PR 10427 at commit
|
There was a problem hiding this comment.
We can make JDBCRDD.compileFiltersprivate[jdbc], and then simplify this one to compileFilter(filter) != null.
SparkQA
commented
Dec 22, 2015
Test build #48187 has finished for PR 10427 at commit
|
There was a problem hiding this comment.
Nit: It's a little bit weird to use double-negation here when filters.filter(JDBCRDD.compileFilter(_) == null) is perfectly OK.
SparkQA
commented
Dec 22, 2015
Test build #48201 has finished for PR 10427 at commit
|
liancheng
commented
Dec 22, 2015
Overall LGTM. Would like to ask @yhuai to have a look, though. |
HyukjinKwon
commented
Dec 24, 2015
Let me leave one more comment. I tested some cases with this PR and looks generally working fine. But I would like to mention one thing that I am pretty sure you folks already know though. Since now For example, in case of Parquet, I implemented this locally and tested and found it calculating a wrong result. That produced the plans below: Here, I could find any I tried with the original code and it showed the plan below assigning The reason seems that it adds all the columns in projects and filters to For this So please take this into account. +Actually, I think it should include the columns in pushed filters for |
c362c91 to
da07ac5CompareSparkQA
commented
Dec 24, 2015
Test build #48277 has finished for PR 10427 at commit
|
maropu
commented
Dec 24, 2015
@HyukjinKwon ISTM the root problem is that catalyst cannot fill required columns on-the-fly for data sources. The interface |
HyukjinKwon
commented
Dec 24, 2015
@maropu I believe it might be about a Parquet stuff. AFAIK, the columns in filters should be set to Actually, I am now talking with @yhuai to check if it is really an issue. For me I think we can simply include the columns for pushed filters as well just for safety. |
maropu
commented
Dec 24, 2015
If this patch merged, the comment below is not suitable for Is it okay to fix it? |
HyukjinKwon
commented
Dec 24, 2015
And you are right I think the comment I said is not related with this PR. Let's wait for their comments! |
maropu
commented
Dec 24, 2015
@HyukjinKwon Adding a special handing for Parquet is better? I think that required columns for push-down filters should be passed to each data sources, and this is a more natural way. |
HyukjinKwon
commented
Dec 24, 2015
@maropu I agree that can be another way! but I just think an interface should be inclusive not exclusive. Handing in |
maropu
commented
Dec 24, 2015
@HyukjinKwon Anyway, I added a test by reflecting this discussion. thanks. |
maropu
commented
Feb 5, 2016
@yhuai ping |
maropu
commented
Feb 5, 2016
@yhuai fixed. |
SparkQA
commented
Feb 5, 2016
Test build #50818 has finished for PR 10427 at commit
|
There was a problem hiding this comment.
Thank you for the update!
When we were using == null (I guess all filters were marked as unhandled, right?), all tests still passed. So, I am wondering if existing tests are sufficient?
There was a problem hiding this comment.
Added tests though, ISTM that JDBCRDD.compileFilter does not return None for given Filter because the function can compile all the Filter implemented in sql.sources.filters.
SparkQA
commented
Feb 7, 2016
Test build #50904 has finished for PR 10427 at commit
|
yhuai
commented
Feb 8, 2016
Thank you for the update! Overall looks good. There are two lines of unnecessary changes. Let's remove them and we can merge it once it passes jenkins. |
2b9c766 to
7038bc0CompareSparkQA
commented
Feb 9, 2016
Test build #50968 has finished for PR 10427 at commit
|
7038bc0 to
7a7b9faCompareSparkQA
commented
Feb 9, 2016
Test build #50976 has finished for PR 10427 at commit
|
maropu
commented
Feb 10, 2016
@yhuai okay, ready to commit. |
yhuai
commented
Feb 10, 2016
LGTM. Merging to master. |
…emoving unnecessary Spark Filter apache#10427
Input: SELECT * FROM jdbcTable WHERE col0 = 'xxx'
Current plan:
This patch enables a plan below;