Skip to content

[SPARK-36647][SQL][TESTS] Push down Aggregate (Min/Max/Count) for Parquet if filter is on partition col - #34248

Closed
huaxingao wants to merge 5 commits into
apache:masterfrom
huaxingao:partitionFilter
Closed

[SPARK-36647][SQL][TESTS] Push down Aggregate (Min/Max/Count) for Parquet if filter is on partition col#34248
huaxingao wants to merge 5 commits into
apache:masterfrom
huaxingao:partitionFilter

Conversation

@huaxingao

Copy link
Copy Markdown
Contributor

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

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48587/

@HyukjinKwonHyukjinKwon changed the title [SPARK-36647][SQL] Push down Aggregate (Min/Max/Count) for Parquet if filter is on partition col[SPARK-36647][SQL][TESTS] Push down Aggregate (Min/Max/Count) for Parquet if filter is on partition colOct 12, 2021
@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48587/

@SparkQA

Copy link
Copy Markdown

Test build #144110 has finished for PR 34248 at commit cd22629.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

c21
c21 approved these changes Oct 12, 2021

@c21c21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @huaxingao.

Comment on lines +249 to +250
val enableVectorizedReader = Seq("false", "true")
for (testVectorizedReader <- enableVectorizedReader) {

Copy link
Copy Markdown
Contributor

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(...) {
...
}
}

Copy link
Copy Markdown
ContributorAuthor

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.

@huaxingao

Copy link
Copy Markdown
ContributorAuthor

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")

Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
ContributorAuthor

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.

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48655/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48655/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48659/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48658/

Comment on lines +133 to +134
// However, if the filter or group by is on partition column,
// max/min/count can still be pushed down

Copy link
Copy Markdown
Member

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.

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48659/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48658/

@SparkQA

Copy link
Copy Markdown

Test build #144177 has finished for PR 34248 at commit 6cc6f7b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA

Copy link
Copy Markdown

Test build #144180 has finished for PR 34248 at commit 1c96138.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48854/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48854/

@SparkQA

Copy link
Copy Markdown

Test build #144380 has finished for PR 34248 at commit 1293ae0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@viirya

Copy link
Copy Markdown
Member

retest this please

@viirya

Copy link
Copy Markdown
Member

I'll merge this after CI, since last CI was a few days ago.

@SparkQA

Copy link
Copy Markdown

Test build #144626 has started for PR 34248 at commit 1293ae0.

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49096/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49096/

@viirya

Copy link
Copy Markdown
Member

retest this please

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49103/

@SparkQA

Copy link
Copy Markdown

Test build #144633 has finished for PR 34248 at commit 1293ae0.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@huaxingao

Copy link
Copy Markdown
ContributorAuthor

retest this please

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49103/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49106/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49106/

@SparkQA

Copy link
Copy Markdown

Test build #144636 has finished for PR 34248 at commit 1293ae0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@viirya

Copy link
Copy Markdown
Member

Thanks! Merging to master.

@huaxingao

Copy link
Copy Markdown
ContributorAuthor

Thanks @c21@viirya

@huaxingao
huaxingao deleted the partitionFilter branch October 27, 2021 07:20
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@huaxingao@SparkQA@viirya@c21