Skip to content

[python] Preserve sequence.field bindings across column renames - #11634

Draft
taoran92 wants to merge 1 commit into
apache:masterfrom
taoran92:fix/python-sequence-field-column-rename
Draft

taoran92 wants to merge 1 commit into
apache:masterfrom
taoran92:fix/python-sequence-field-column-rename

Conversation

@taoran92

@taoran92 taoran92 commented Dec 2, 2026

Copy link
Copy Markdown
Member

Purpose

Fixes #11633

With sequence.field='t0, ts', renaming ts to stamp in PyPaimon's filesystem catalog can leave the option pointing to ts. Reads fail if the old name disappears and can select the wrong row version if another column takes that name.

Resolve sequence fields in their configured order and follow their field IDs through the ALTER batch. In this example, the catalog stores t0,stamp and keeps the original ts column as the tie-breaker, even if another column becomes ts. A SET that changes the option text resolves names against the schema at that point in the batch. Repeating the same text preserves the existing binding. A rename to an empty column name stores that sequence entry as a single space. If the option is t0, and an existing empty-named column is renamed to stamp, the catalog stores t0,stamp to preserve the SQLContext ordering.

Tests

  • Added regressions for padded and unpadded sequence options, name reuse and repeated renames within an ALTER batch, SET behavior, trailing separators, and empty or control-character column names.
  • The SQLContext suite and a native-plan sequence-ordering test passed with pypaimon-rust 0.5.0 (19 tests).
  • The sequence-field read and write, schema manager, and primary-key schema evolution suites passed in Python execution mode (170 tests).

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.

[Bug] Renaming a sequence field can break PyPaimon reads or select the wrong row version

1 participant