-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-20331][SQL][FOLLOW-UP] Add a SQLConf for enhanced Hive partition pruning predicate pushdown #19547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Test build #82944 has finished for PR 19547 at commit
|
| convertComplexFilters(table, filters) | ||
| } else { | ||
| convertBasicFilters(table, filters) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, Can we remove the duplication of varcharKeys logic by moving into convertFilters like the following? table was removed from convertBasicFilters and convertCompexFilters, too.
def convertFilters(table: Table, filters: Seq[Expression]): String = {
// hive varchar is treated as catalyst string, but hive varchar can't be pushed down.
lazy val varcharKeys = table.getPartitionKeys.asScala
.filter(col => col.getType.startsWith(serdeConstants.VARCHAR_TYPE_NAME) ||
col.getType.startsWith(serdeConstants.CHAR_TYPE_NAME))
.map(col => col.getName).toSet
if (SQLConf.get.advancedPartitionPredicatePushdownEnabled) {
convertComplexFilters(filters, varcharKeys)
} else {
convertBasicFilters(filters, varcharKeys)
}
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! We can do it when enhancing convertComplexFilters . Here, it is just to keep the original codes (from Spark 2.2) untouched.
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, LGTM.
This is really great to have this option. Thank you so much!
|
Thanks! Merged to master. |
…on pruning predicate pushdown ## What changes were proposed in this pull request? This is a follow-up PR of apache#17633. This PR is to add a conf `spark.sql.hive.advancedPartitionPredicatePushdown.enabled`, which can be used to turn the enhancement off. ## How was this patch tested? Add a test case Author: gatorsmile <gatorsmile@gmail.com> Closes apache#19547 from gatorsmile/Spark20331FollowUp. (cherry picked from commit d8cada8)
…on pruning predicate pushdown This is a follow-up PR of apache#17633. This PR is to add a conf `spark.sql.hive.advancedPartitionPredicatePushdown.enabled`, which can be used to turn the enhancement off. Add a test case Author: gatorsmile <gatorsmile@gmail.com> Closes apache#19547 from gatorsmile/Spark20331FollowUp. (cherry picked from commit d8cada8) Conflicts: sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
…on pruning predicate pushdown ## What changes were proposed in this pull request? This is a follow-up PR of apache#17633. This PR is to add a conf `spark.sql.hive.advancedPartitionPredicatePushdown.enabled`, which can be used to turn the enhancement off. ## How was this patch tested? Add a test case Author: gatorsmile <gatorsmile@gmail.com> Closes apache#19547 from gatorsmile/Spark20331FollowUp.
What changes were proposed in this pull request?
This is a follow-up PR of #17633.
This PR is to add a conf
spark.sql.hive.advancedPartitionPredicatePushdown.enabled, which can be used to turn the enhancement off.How was this patch tested?
Add a test case