Skip to content
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

[spark] Support auto disable bucketed scan #3928

Merged
merged 4 commits into from
Aug 16, 2024

Conversation

ulysses-you
Copy link
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
Contributor

It seems spark test failed.

@ulysses-you
Copy link
Contributor Author

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

@ulysses-you
Copy link
Contributor Author

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

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

@JingsongLi JingsongLi left a comment

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.

extends PaimonBaseScan(table, requiredSchema, filters, reservedFilters, pushDownLimit)
with SupportsRuntimeFiltering
with SupportsReportPartitioning {

override def outputPartitioning(): Partitioning = {
def withDisabledBucketedScan(): PaimonScan = {
Copy link
Contributor

Choose a reason for hiding this comment

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

disableBucketedScan

Copy link
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
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
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
Contributor

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

@JingsongLi JingsongLi merged commit a7e7bf6 into apache:master Aug 16, 2024
10 checks passed
@ulysses-you ulysses-you deleted the bucketed branch August 16, 2024 06:37
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