Skip to content

[1049] Drop every column that one Iceberg schema sync removes - #17

Draft
yihua wants to merge 1 commit into
ptf-review-build-upgradefrom
ptf-review-drop-removed-columns
Draft

yihua wants to merge 1 commit into
ptf-review-build-upgradefrom
ptf-review-drop-removed-columns

Conversation

@yihua

@yihua yihua commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Important Read

Issue: apache#1049, part of apache#722. Based on #8; review that first. The change is already on iceberg-v3-ptf-poc, which is not meant to land as one PR, so this PR carries one area of it for review.

What is the purpose of the pull request

IcebergSchemaSync put every dropped column under the same map key, so one sync that removed several columns dropped only one of them. A drop is now keyed by the negative field id of its column, which keeps the drops first and one entry per column.

Brief change log

  • IcebergSchemaSync keys drops by negative field id.
  • A new test removes two columns in one sync.

Verify this pull request

This change added tests and can be verified as follows:

  • A new case in TestIcebergSchemaSync removes two columns in one sync and expects both to be dropped; it fails without the fix, which drops only one.
  • Run locally on JDK 17 at this PR's level: 582 xtable-core unit tests and 9 xtable-core Iceberg ITs pass, and the Iceberg table format's 26 unit tests and 46 ITs pass (1 skipped).

The schema sync collects its updates in a map by field id and put every
dropped column under the key 0, so that drops run first. When one sync
removed several columns, each drop replaced the one before it in the map
and a single column was dropped. The others stayed in the Iceberg schema
and were dropped one per later sync.

A drop is now keyed by the negative field id of its column, which still
runs the drops first and keeps one entry per column. A new test removes
two columns in one sync and expects both to be dropped.
@yihua
yihua force-pushed the ptf-review-drop-removed-columns branch from f3c5795 to 4404a11 Compare November 24, 2026 20:56
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.

1 participant