Bound composite-key merge predicates - #24
Closed
nicosuave wants to merge 1 commit into
Closed
Conversation
This was referenced Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
merge_composite_key_batch_sizesetting (default 500)merge_batch_size=500000behavior for single-key merges, whose match filter is a flatINexpressionEvidence and rationale
Production on macOS arm64 with dlt-iceberg 0.6.2, PyIceberg 0.11.1, and AWS S3 Tables exited with SIGBUS when a growing table received roughly 1,018 composite-key rows in one merge transaction; 515 rows succeeded.
PyIceberg builds a single-key match as an
Inpredicate, but composite keys become a nestedOrof per-rowAndpredicates. The general 500,000-row batch limit therefore remains appropriate for the flatter single-key path, while composite expressions get a separate conservative cap below the observed failure boundary.PyIceberg 0.11.1 is currently the latest stable release, and its patch release changes do not include a fix for this merge-expression failure mode. The transaction APIs used here are available in both the project's declared minimum PyIceberg 0.10.0 and current 0.11.1.
Upstream implementation references:
Atomicity and performance
All batches for one table are staged through
Transaction.delete,Transaction.upsert, andTransaction.append, then published by one catalog metadata commit. Readers of the current table reference therefore see either the pre-merge state or the completed merge state. A failure before transaction exit does not publish a partial batch.Atomicity remains per table, as before. It does not cover multiple tables in one dlt load, and prior table creation/schema-evolution commits are separate. Failed writes may leave unreferenced data files for normal Iceberg orphan-file cleanup.
The composite safety cap trades additional scans and staged snapshot updates for bounded native expression size. Operators can tune
merge_composite_key_batch_sizeupward after workload-specific testing;merge_batch_sizecontinues to act as the overall ceiling.Validation
uv run pytest -q— 184 passed, 15 skipped (PyIceberg 0.11.1)uv lock --checkgit diff --check