[core] Support bucket-first sorting for manifest files - #9792
Conversation
JingsongLi
left a comment
There was a problem hiding this comment.
Left comments:
- Concept: Sorting should be based on buckets by default; there is no need to introduce a new option.
- Implementation: Similar to
rowIdSort, if it is a bucketed table, instantiate a new implementation class withincreateSortKey.
|
Geely isolated performance validation is complete. Setup
Results
Bucket-first won all 12/12 paired runs. The median paired speedup was 2.2326x (range 2.0602x–2.4032x). All 24 measured queries had identical scan invariants: snapshot 2347, 12,830 skipped files, 54 resulting files, 25 splits, and 1,000 returned rows at the configured result limit. Correctness was checked without the result limit: both arms returned 4,280 rows and the same duplicate-preserving aggregate fingerprint ( The temporary branches/tag were deleted after measurement. The customer main table was not altered or compacted. The Spark catalog workaround was removed and the session was stopped. |
|
Thanks @JingsongLi, addressed in
Focused tests pass (151 run, 0 failures, 1 skipped), and the non-fast |
|
+1 |
Purpose
This is the first layout follow-up split from #9784 after review feedback. #9791 has already merged the independent manifest bucket-pruning change. This PR makes manifest sorting bucket-first by default for fixed-bucket tables.
Changes
BucketSortKeyinsidecreateSortKeyfor fixed-bucket tables.RowIdSortKeyfor data-evolution tables.Forced manifest rewrites, pruning metadata/filter logic, mixed-count pruning, and other optimizations are intentionally excluded.
Production validation
On an isolated Geely snapshot, bucket-first reduced median statement execution from 13.0315 s to 5.8440 s (55.15%, 2.23x), reduced median planning from 9.55 s to 2.30 s (75.92%), and reduced scanned manifests from 14 to 1. It won all 12 alternating paired runs. Correctness matched at 4,280 rows with the same duplicate-preserving fingerprint.
Full setup, raw metrics, correctness checks, and cleanup evidence are recorded in the PR validation comment.
Verification
paimon-corereactor compile: Checkstyle, Spotless, Maven Enforcer, and compilation passed.