Skip to content

[core] Preserve sequence-group field bindings on column rename - #1560

Draft
taoran92 wants to merge 1 commit into
apache:mainfrom
taoran92:fix/sequence-group-column-rename
Draft

taoran92 wants to merge 1 commit into
apache:mainfrom
taoran92:fix/sequence-group-column-rename

Conversation

@taoran92

@taoran92 taoran92 commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Purpose

Closes #1559

On a partial-update table with columns channel and " channel ", a single group defined as fields.ts.sequence-group=' channel ' protects channel. Renaming " channel " to aux can move that protection to aux, allowing an older update to overwrite channel. A successful rename should preserve which columns the group orders and protects.

Brief change log

  • Resolve active sequence-group references against the fields present before each rename. Renaming b to c in the protected list a, b stores a,c. Apply the same rule to ordering columns and their sort-order option keys.
  • Reject the rename before publishing the schema if the literal and trimmed names identify different existing columns, the new name cannot be represented as one group member, or a rewritten key would overwrite another group option on the existing table.

Tests

  • cargo test --locked -p paimon --lib spec:: — 738 passed.
  • cargo test --locked -p paimon-datafusion --test sql_context_tests — 87 passed.
  • cargo fmt --all -- --check passed.

API and Format

The change affects validation and rewriting of table options during RENAME COLUMN. It uses the existing public API and schema format.

Documentation

This corrects the behavior of the existing RENAME COLUMN operation.

@taoran92
taoran92 marked this pull request as ready for review November 28, 2026 15:15
@taoran92
taoran92 force-pushed the fix/sequence-group-column-rename branch from c5f0c69 to 6ab1ec5 Compare November 29, 2026 13:24
@taoran92
taoran92 marked this pull request as draft November 29, 2026 13:55
@taoran92
taoran92 force-pushed the fix/sequence-group-column-rename branch from 6ab1ec5 to acfea88 Compare November 29, 2026 14:39
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.

RENAME COLUMN can change which field a sequence group protects

1 participant