Skip to content

[lake/iceberg] Support multi-bucket-key and non-string partition keys - #4070

Open
qzyu999 wants to merge 1 commit into
apache:mainfrom
qzyu999:lake/iceberg-multi-bucket-key
Open

[lake/iceberg] Support multi-bucket-key and non-string partition keys#4070
qzyu999 wants to merge 1 commit into
apache:mainfrom
qzyu999:lake/iceberg-multi-bucket-key

Conversation

@qzyu999

@qzyu999 qzyu999 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes two artificial restrictions from Iceberg lake table creation that limited partition spec construction to single-key buckets and string-only partitions. Both are Fluss-imposed limitations, not Iceberg format limitations.

Closes #4069, closes #1832.

Changes

Commit 1: Multi-bucket-key support

  • Removes the bucketKeys.size() > 1 restriction
  • For multi-key tables, uses identity(__bucket) Fluss already computes the composite hash and stores it in the system column
  • Single-key tables unchanged (still use bucket(key, count) transform)

Commit 2: Non-string partition key support

  • Removes the STRING type check for partition keys
  • Iceberg's identity() transform works on any primitive type (INT, LONG, DATE, BOOLEAN, etc.)
  • Fixes IcebergSplitPlanner to extract partition values via Object.class + String.valueOf() instead of hardcoded String.class

Tests

All 26 IcebergLakeCatalogTest tests pass. The tests that previously expected exceptions now verify successful table creation.

builder.bucket(bucketKeys.get(0), bucketCount);
} else {
// Multiple bucket keys for log table: use identity(__bucket)
builder.identity(BUCKET_COLUMN_NAME);

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.

in #4019 , the legacy field has been removed for new tables.

Removes two artificial restrictions from Iceberg lake table creation:

1. Multi-bucket-key: Removes the 'only one bucket key' restriction.
   For multi-key tables, uses bucket(firstKey, bucketCount) in the
   partition spec. The tiering writer explicitly assigns partition
   values via PartitionKey, so correctness is maintained. The spec
   provides approximate scan pruning.

2. Non-string partitions: Removes the STRING type check. Iceberg's
   identity() transform works on any primitive type. Updates
   IcebergSplitPlanner to extract partition values via Object.class
   + String.valueOf() for type-agnostic conversion.

Closes apache#4069, closes apache#1832.
@qzyu999
qzyu999 force-pushed the lake/iceberg-multi-bucket-key branch from 6f1cc7a to 3059884 Compare August 25, 2026 04:23
@qzyu999

qzyu999 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @litiliu rebased on main (which now includes #4019). The partition spec no longer uses identity(__bucket) for multi-key tables. Instead, it uses bucket(firstBucketKey, bucketCount) for all cases where bucket keys exist (single or multi). The tiering writer explicitly assigns partition values via PartitionKey, so the first-key-only spec is sufficient for routing. For read pruning it provides approximate but never incorrect filtering.

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.

[lake/iceberg] Support multi-bucket-key tables [lake/iceberg] Iceberg lake table support non-string partition keys

2 participants