Skip to content

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

Draft
yihua wants to merge 1 commit into
apache:mainfrom
yihua:xt-1049-drop-removed-columns
Draft

yihua wants to merge 1 commit into
apache:mainfrom
yihua:xt-1049-drop-removed-columns

Conversation

@yihua

@yihua yihua commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Important Read

Closes #1049, part of #722.

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 11: 597 xtable-core unit tests pass (3 skipped), the 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.

This branch has not been deployed

No deployments
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.

Iceberg schema sync drops only one of the columns removed in a single sync

1 participant