Repository navigation
Conversation
On tables partitioned by bucket, month or year, a CDC read left out the DELETE made by an equality delete, a position delete or a deletion vector, so the change stream said the row still existed. A DELETE in a null partition went missing whenever the planned snapshot also touched a non-null partition, by a delete or only by an append. A NaN partition value failed the read with "Cannot create expression literal from NaN". To find the data files that a snapshot's deletes touch, the changelog scan pruned data manifests with a filter that compared each affected partition value with the source column. A bucket, month or year is not a value of its source column, so the right manifests were dropped; null values were left out of the filter, and NaN cannot be a literal. Match each affected partition on the partition fields of its own spec instead, with IS NULL and IS NAN for null and NaN values and a nanosecond literal for timestamp_ns values. The partitions of a spec are combined into a balanced OR, so many affected partitions cannot overflow the stack, and bound once per spec, case-sensitively since the names come from the spec itself. Manifests of a spec with no affected partition are skipped, unpartitioned ones included: a delete applies only to data files of its own spec, and a global delete still keeps every manifest. When matching fails, the manifests are kept and a warning is logged. DELETEs that a CDC read already dropped stay dropped: to get them, re-read from a snapshot before the first affected delete.
claudevdm
force-pushed
the
iceberg-fix-cdc-partition-match
branch
from
December 5, 2026 16:16
054d16a to
f303d7b
Compare
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.
On tables partitioned by bucket, month or year, a CDC read left out the DELETE made by an equality or position delete, so the change stream said the row still existed. A DELETE in a null partition went missing when the same snapshot also deleted in another partition, and a NaN partition value failed the read with "Cannot create expression literal from NaN".
To find the data files that a snapshot's deletes touch, the changelog scan pruned manifests with a filter that compared each affected partition value with the source column. A bucket, month or year is not a value of its source column, so the right manifests were dropped; null values were left out of the filter, and NaN cannot be a literal. Match each affected partition on the partition fields of its own spec instead, with IS NULL and IS NAN for null and NaN values.