Skip to content

feat(core): Add bucket function implementation#218

Merged
lxy-9602 merged 17 commits intoalibaba:mainfrom
ChaomingZhangCN:bucket-function-v2
Apr 15, 2026
Merged

feat(core): Add bucket function implementation#218
lxy-9602 merged 17 commits intoalibaba:mainfrom
ChaomingZhangCN:bucket-function-v2

Conversation

@ChaomingZhangCN
Copy link
Copy Markdown
Contributor

@ChaomingZhangCN ChaomingZhangCN commented Apr 10, 2026

Purpose

Linked issue: close #173

Tests

API and Format

Documentation

Generative AI tooling

Generated-by: Claude Code

- Add BucketFunction interface and BucketFunctionType enum
- Implement ModBucketFunction for hash-based bucket assignment
- Implement DefaultBucketFunction for default bucket behavior
- Add bucket_num option to CoreOptions
- Extend BucketIdCalculator to support bucket function
- Add unit tests for bucket functions and related components
- Add HiveHasher utility with Hive-compatible hash functions for
  int, long, bytes, and decimal types
- Implement HiveBucketFunction aligned with Java HiveBucketFunction,
  supporting BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE,
  STRING, BINARY, DECIMAL, and DATE field types
- Handle special cases: -0.0f/0.0 normalization, decimal trailing
  zero stripping, and null field hashing
- Add comprehensive unit tests covering mixed types, nulls,
  negative zero, and edge cases
@ChaomingZhangCN ChaomingZhangCN changed the title Bucket function v2 feat(core): add bucket function implementation Apr 10, 2026
@ChaomingZhangCN ChaomingZhangCN changed the title feat(core): add bucket function implementation feat(core): Add bucket function implementation Apr 10, 2026
lxy-9602
lxy-9602 previously approved these changes Apr 14, 2026
Copy link
Copy Markdown
Collaborator

@lxy-9602 lxy-9602 left a comment

Choose a reason for hiding this comment

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

+1

lxy-9602
lxy-9602 previously approved these changes Apr 15, 2026
Copy link
Copy Markdown
Collaborator

@lxy-9602 lxy-9602 left a comment

Choose a reason for hiding this comment

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

+1

@lxy-9602 lxy-9602 merged commit 37b35c7 into alibaba:main Apr 15, 2026
9 checks passed
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.

[Feature] Add support of hive bucket function

3 participants