Skip to content

HIVE-28798: Bucket Map Join partially using partition transforms - #5670

Merged
okumin merged 5 commits into
apache:masterfrom
okumin:HIVE-28798-partial-bucket
Jul 18, 2025
Merged

HIVE-28798: Bucket Map Join partially using partition transforms#5670
okumin merged 5 commits into
apache:masterfrom
okumin:HIVE-28798-partial-bucket

Conversation

@okumin

@okumin okumin commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This PR updates OpTraitsRulesProcFactory.SelectRule to propagate bucketing information when the source is an Iceberg table, and only a subset of bucketing columns is used.

https://issues.apache.org/jira/browse/HIVE-28798

Why are the changes needed?

For better performance. Iceberg's transform spec allows us to bucketize multiple columns separately, e.g., stored in /warehouse/db/table/data/key1=3/key2=5. Hive's one encodes a set of all bucketing columns into a single integer.

Does this PR introduce any user-facing change?

No. The query plan can change, but BMJ on Iceberg has not been released yet.

Is the change a dependency upgrade?

No

How was this patch tested?

I updated iceberg_bucket_map_join_8.q so that it includes various combinations.

(103, null, 'val_103', 18),
(104, '1004', null, 19),
(105, '1005', 'val_105', 20),
(null, null, null, 21);

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.

I added many records so that the big table detection always picks up src_small

@okumin okumin changed the title [WIP] HIVE-28798: Bucket Map Join partially using partition transforms HIVE-28798: Bucket Map Join partially using partition transforms Mar 4, 2025
@okumin
okumin marked this pull request as ready for review March 4, 2025 03:10
newBucketFunctions.add(null);
break;
}
Optional<CustomBucketFunction> newBucketFunction = bucketFunction.select(retainedColumns);

@okumin okumin Mar 4, 2025

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.

I finally want to implement Hive's v1 and v2 bucketing as CustomBucketFunctions to unify the logic

@sonarqubecloud

Copy link
Copy Markdown

@okumin

okumin commented Jul 14, 2025

Copy link
Copy Markdown
Contributor Author

I rebased this branch since it is too obsolete. Now, CI is green.

@ngsg ngsg 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, +1

@okumin

okumin commented Jul 18, 2025

Copy link
Copy Markdown
Contributor Author

@ngsg Thanks for your thorough review!

@okumin
okumin merged commit bfac94f into apache:master Jul 18, 2025
@okumin
okumin deleted the HIVE-28798-partial-bucket branch July 18, 2025 12:24
nareshpr pushed a commit to nareshpr/hive-1 that referenced this pull request Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants