Skip to content

Core, Spark: Fix equality deletes non-deterministic schema ordering (#13873)(Backports #15514)#15605

Merged
amogh-jahagirdar merged 1 commit into
apache:1.10.xfrom
RussellSpitzer:backport-15514-1.10
Mar 12, 2026
Merged

Core, Spark: Fix equality deletes non-deterministic schema ordering (#13873)(Backports #15514)#15605
amogh-jahagirdar merged 1 commit into
apache:1.10.xfrom
RussellSpitzer:backport-15514-1.10

Conversation

@RussellSpitzer

Copy link
Copy Markdown
Member

Equality delete schemas constructed in DeleteFilter.applyEqDeletes relied on the field order of requiredSchema, which varies depending on the query's projection. When the SparkExecutorCache returned delete records read with one field ordering to a reader expecting another, StructProjection silently misinterpreted the positional data, causing deletes to be skipped.

We fix this by Canonicalize the deleteSchema by sorting fields by field ID. Now every reader produces the same schema for deletes regardless of projection, ensuring cache hits return correctly ordered records.

Coded with the help of Cursor and claude-4.6.opus-high

…pache#13873)

Equality delete schemas constructed in DeleteFilter.applyEqDeletes relied on
the field order of requiredSchema, which varies depending on the query's
projection. When the SparkExecutorCache returned delete records read with one
field ordering to a reader expecting another, StructProjection silently
misinterpreted the positional data, causing deletes to be skipped.

We fix this by Canonicalize the deleteSchema by sorting fields by field ID. Now
every reader produces the same schema for deletes regardless of projection,
ensuring cache hits return correctly ordered records.

Coded with the help of Cursor and claude-4.6.opus-high
@RussellSpitzer RussellSpitzer added this to the Iceberg 1.10.2 milestone Mar 12, 2026
@RussellSpitzer RussellSpitzer added the bug Something isn't working label Mar 12, 2026

@amogh-jahagirdar amogh-jahagirdar left a comment

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.

Looks like a clean backport, thank you @RussellSpitzer!

@amogh-jahagirdar amogh-jahagirdar merged commit ca3f8cf into apache:1.10.x Mar 12, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API bug Something isn't working data spark

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants