Skip to content

WIP: Iceberg bucket partitioning as the default for integer ID columns - #280

Draft
bdpedigo wants to merge 3 commits into
masterfrom
bucket-partitioning
Draft

bdpedigo wants to merge 3 commits into
masterfrom
bucket-partitioning

Conversation

@bdpedigo

@bdpedigo bdpedigo commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • New bucket partition strategy for the Delta Lake export. It uses the Iceberg bucket[N] transform from cavebear, and stores the spec in the table property cave.partition_spec.
  • Integer ID columns (the primary key, B-tree index columns, the view id) now default to bucket. non-integer columns keep percentile_range, and Morton keeps uniform_range (for now).
  • The old hash strategy is removed, because it was not portable or stable across polars versions.
  • A bucket count must be a power of two. auto rounds up, and the wizard shows an error for a bad count.
  • Bumps deltalake>=1.6 (needed by cavebear) and polars>=2.1. deltalake 1.6.4 truncates timestamp stats to milliseconds, and older polars then skips files with matching rows.
  • CI now uses PostGIS 18 instead of 13. The new runner's Postgres 18 pg_dump writes a setting that Postgres 13 rejects, so the pg_dump transfer test failed.

Closes #274

Evidence

  • Unit tests: 861 passed, 57 skipped (with a PostGIS container, as in CI).
  • A local export of a real table with an 8-bucket pt_root_id spec gave 8 partitions, and all sampled rows were in the right bucket.

WIP

  • Not tried in a browser yet: wizard step 2.
  • Not tried on minnie, only LTV

bdpedigo and others added 3 commits November 24, 2026 15:03
- Replace the "hash" strategy (polars hash, not portable) with "bucket",
  the Iceberg bucket[N] transform from cavebear. The export stores the
  spec in the Delta table configuration (cave.partition_spec).
- Discovery gives "bucket" to integer PK and B-tree index columns, and
  to the view id. Other columns keep percentile_range.
- A bucket count must be "auto" or a power of two in [1, 2**30]. Auto
  rounds up. The wizard shows the error and disables Next.
- Depend on cavebear (pinned commit) and deltalake>=1.6.
- deltalake 1.6 writes timestamp stats in milliseconds: update the root
  ID update log test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
deltalake 1.6.4 writes timestamp min/max stats truncated to
milliseconds (delta-rs #4690), so a file's max can be up to 999 us
before its real max. polars < 2.1 compared filters with that max and
skipped files with matching rows: scan_delta returned no rows for
end_time_stamp == run end (fixed in polars #30194).

- Require polars>=2.1. Pin cavebear d335ccb, which does the same.
- Test that a polars filter on a run end finds the run (it fails on
  polars 1.39.3), and explain the truncated max in the stats test.
- Tell readers of the root ID update log which readers widen the max.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ubuntu-26.04 runner has the Postgres 18 client. Its pg_dump writes
SET transaction_timeout, which Postgres 13 rejects, so the pg_dump
transfer test restored 0 rows. The engine image also uses the
Postgres 18 client.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Implement hashing IDs via Iceberg's bucket scheme as default partitioning for ID columns

1 participant