-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-36647][SQL][TESTS] Push down Aggregate (Min/Max/Count) for Parquet if filter is on partition col #34248
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
… filter is on partition col
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Test build #144110 has finished for PR 34248 at commit
|
c21
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.
LGTM, thanks @huaxingao.
| val enableVectorizedReader = Seq("false", "true") | ||
| for (testVectorizedReader <- enableVectorizedReader) { |
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: we can be more scala here, but not a big deal:
Seq("false", "true").foreach { enableVectorizedReader =>
withSQLConf(...) {
...
}
}
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.
@c21 Thanks for reviewing! I fixed this.
|
cc @viirya Could you please take a look when you have time? Thanks! |
| Seq("false", "true").foreach { enableVectorizedReader => | ||
| withSQLConf(SQLConf.PARQUET_AGGREGATE_PUSHDOWN_ENABLED.key -> "true", | ||
| vectorizedReaderEnabledKey -> enableVectorizedReader) { | ||
| val max = sql("SELECT max(id) FROM tmp WHERE p = 0") |
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.
Can you add other two supported aggregate functions? And how about group by on partition column case?
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.
added.
Group by on partition column is a little more complicated and needs some code changes: currently, we only have the aggregate values in the returned row. For group by on partition column, we will need to pass down the partition col value and prepend that value to the aggregation row. I will have a separate PR for that work.
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Kubernetes integration test starting |
|
Kubernetes integration test starting |
| // However, if the filter or group by is on partition column, | ||
| // max/min/count can still be pushed down |
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.
So group by on partition column is not supported yet. Then this comment is not correct.
|
Kubernetes integration test status failure |
|
Kubernetes integration test status failure |
|
Test build #144177 has finished for PR 34248 at commit
|
|
Test build #144180 has finished for PR 34248 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Test build #144380 has finished for PR 34248 at commit
|
|
retest this please |
|
I'll merge this after CI, since last CI was a few days ago. |
|
Test build #144626 has started for PR 34248 at commit |
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
retest this please |
|
Kubernetes integration test starting |
|
Test build #144633 has finished for PR 34248 at commit
|
|
retest this please |
|
Kubernetes integration test status failure |
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Test build #144636 has finished for PR 34248 at commit
|
|
Thanks! Merging to master. |
What changes were proposed in this pull request?
I just realized that with the changes in #33650, the restriction for not pushing down Min/Max/Count for partition filter was already removed. This PR just added test to make sure Min/Max/Count in parquet are pushed down if filter is on partition col.
Why are the changes needed?
To complete the work for Aggregate (Min/Max/Count) push down for Parquet
Does this PR introduce any user-facing change?
No
How was this patch tested?
new test