Skip to content

[spark] Support auto disable bucketed scan - #3928

Merged
JingsongLi merged 4 commits into
apache:masterfrom
ulysses-you:bucketed
Aug 16, 2024
Merged

JingsongLi merged 4 commits into
apache:masterfrom
ulysses-you:bucketed

Conversation

@ulysses-you

Copy link
Copy Markdown
Contributor

Purpose

This pr adds a new rule DisableUnnecessaryPaimonBucketedScan to support auto disable bucketed scan if the bucket scan is not actually effective i.e., there is no shuffle exchange been removed. This change is to avoid performance regression since the bucketed scan may have smaller parallelism than normal scan.

For example: a table with bucket key x but user join/group-by/partition-by on column y.

Note, this rule is inspired from Spark DisableUnnecessaryBucketedScan but work for v2 scan.

Tests

Add test.

API and Format

no

Documentation

@JingsongLi

Copy link
Copy Markdown
Contributor

It seems spark test failed.

@ulysses-you

Copy link
Copy Markdown
Contributor Author

@JingsongLi thank you for the reminder, it took me a while to find the root cause...

@ulysses-you

Copy link
Copy Markdown
Contributor Author

@JingsongLi @YannByron do you have to take a look ? thank you

@YannByron
YannByron self-requested a review August 13, 2024 01:57

@JingsongLi JingsongLi 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.

Looks good to me! @ulysses-you

Just left one minor comment.

with SupportsReportPartitioning {

override def outputPartitioning(): Partitioning = {
def withDisabledBucketedScan(): PaimonScan = {

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.

disableBucketedScan

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good naming! but it seems conflict with line40..

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.

bucketedScanDisabled and disableBucketedScan?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

+1, addressed

@JingsongLi

Copy link
Copy Markdown
Contributor

+1 Thanks @ulysses-you for the contribution. Merging...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants