Uh oh!
There was an error while loading. Please reload this page.
[SPARK-25559][SQL] Remove the unsupported predicates in Parquet when possible - #22574
[SPARK-25559][SQL] Remove the unsupported predicates in Parquet when possible#22574dbtsai wants to merge 5 commits into
Conversation
dbtsai
commented
Sep 27, 2018
d49d63b to
8c76e31CompareSparkQA
commented
Sep 28, 2018
Test build #96724 has finished for PR 22574 at commit
|
| // If the unsupported predicate is in the top level `And` condition or in the child | ||
| // `And` condition before hitting `Not` or `Or` condition, it can be safely removed. | ||
| (createFilterHelper(nameToParquetField, lhs, canRemoveOneSideInAnd = true), | ||
| createFilterHelper(nameToParquetField, rhs, canRemoveOneSideInAnd = true)) match { |
There was a problem hiding this comment.
There was a problem hiding this comment.
Thanks for catching this. I just fixed it.
Add a nested `And` test case
SparkQA
commented
Sep 28, 2018
Test build #96725 has finished for PR 22574 at commit
|
SparkQA
commented
Sep 28, 2018
Test build #96731 has finished for PR 22574 at commit
|
| } yield FilterApi.and(lhsFilter, rhsFilter) | ||
| // If the unsupported predicate is in the top level `And` condition or in the child | ||
| // `And` condition before hitting `Not` or `Or` condition, it can be safely removed. | ||
| (createFilterHelper(nameToParquetField, lhs, canRemoveOneSideInAnd = true), |
There was a problem hiding this comment.
a bit about style
val lhs = createFilterHelper...
val rhs = createFilterHelper...
(lhs, rhs) match {
...
}
SparkQA
commented
Sep 28, 2018
Test build #96735 has finished for PR 22574 at commit
|
dbtsai
commented
Sep 28, 2018
test this again. |
cloud-fan
commented
Sep 28, 2018
LGTM, pending jenkins |
| // convert b in ('1'). If we only convert a = 2, we will end up with a filter | ||
| // NOT(a = 2), which will generate wrong results. | ||
| // Pushing one side of AND down is only safe to do at the top level. | ||
| // You can see ParquetRelation's initializeLocalJobFunc method as an example. |
There was a problem hiding this comment.
This example is good to show the cases we can't remove one side. Can we still keep it?
There was a problem hiding this comment.
addressed and added more tests.
viirya
commented
Sep 28, 2018
retest this please. |
SparkQA
commented
Sep 28, 2018
Test build #96749 has finished for PR 22574 at commit
|
dongjoon-hyun
commented
Sep 28, 2018
Can we have a more clear title which is described as in the description? Currently, the claim is too broader than the description. |
dongjoon-hyun
commented
Sep 28, 2018
Also, cc @rdblue |
dbtsai
commented
Sep 28, 2018
I changed the title, and hopefully, it's much more clear now. |
SparkQA
commented
Sep 29, 2018
Test build #96775 has finished for PR 22574 at commit
|
dongjoon-hyun
commented
Sep 29, 2018
Merged to master. |
…possible ## What changes were proposed in this pull request? Currently, in `ParquetFilters`, if one of the children predicates is not supported by Parquet, the entire predicates will be thrown away. In fact, if the unsupported predicate is in the top level `And` condition or in the child before hitting `Not` or `Or` condition, it can be safely removed. ## How was this patch tested? Tests are added. Closesapache#22574 from dbtsai/removeUnsupportedPredicatesInParquet. Lead-authored-by: DB Tsai <d_tsai@apple.com> Co-authored-by: Dongjoon Hyun <dongjoon@apache.org> Co-authored-by: DB Tsai <dbtsai@dbtsai.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
…ts in Parquet ## What changes were proposed in this pull request? This is a follow up of #22574. Renamed the parameter and added comments. ## How was this patch tested? N/A Closes#22679 from gatorsmile/followupSPARK-25559. Authored-by: gatorsmile <gatorsmile@gmail.com> Signed-off-by: DB Tsai <d_tsai@apple.com>
…possible ## What changes were proposed in this pull request? Currently, in `ParquetFilters`, if one of the children predicates is not supported by Parquet, the entire predicates will be thrown away. In fact, if the unsupported predicate is in the top level `And` condition or in the child before hitting `Not` or `Or` condition, it can be safely removed. ## How was this patch tested? Tests are added. Closesapache#22574 from dbtsai/removeUnsupportedPredicatesInParquet. Lead-authored-by: DB Tsai <d_tsai@apple.com> Co-authored-by: Dongjoon Hyun <dongjoon@apache.org> Co-authored-by: DB Tsai <dbtsai@dbtsai.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
…ts in Parquet ## What changes were proposed in this pull request? This is a follow up of apache#22574. Renamed the parameter and added comments. ## How was this patch tested? N/A Closesapache#22679 from gatorsmile/followupSPARK-25559. Authored-by: gatorsmile <gatorsmile@gmail.com> Signed-off-by: DB Tsai <d_tsai@apple.com>
## What changes were proposed in this pull request? Inspired by apache#22574 . We can partially push down top level conjunctive predicates to Orc. This PR improves Orc predicate push down in both SQL and Hive module. ## How was this patch tested? New unit test. Closesapache#22684 from gengliangwang/pushOrcFilters. Authored-by: Gengliang Wang <gengliang.wang@databricks.com> Signed-off-by: DB Tsai <d_tsai@apple.com>
What changes were proposed in this pull request?
Currently, in
ParquetFilters, if one of the children predicates is not supported by Parquet, the entire predicates will be thrown away. In fact, if the unsupported predicate is in the top levelAndcondition or in the child before hittingNotorOrcondition, it can be safely removed.How was this patch tested?
Tests are added.