Repository navigation
Conversation
JingsongLi
left a comment
There was a problem hiding this comment.
[P2] Preserve an existing Java-readable sequence binding across Python ALTER
The rewrite resolves sequence entries through Python's strip(), but Java uses String.trim(). I created a primary-key table with columns named ts and \u00a0ts (leading non-breaking space), configured sequence.field=t0,\u00a0ts, wrote two versions, and renamed the latter column to stamp through the PyPaimon filesystem catalog.
The base implementation stored t0,stamp and the Java reader returned amount 100. This head leaves t0,\u00a0ts even though that exact column is gone, and a Java read of the actual table fails with “Sequence field … can not be found in table schema.” Please preserve a valid exact binding or reject an ambiguous cross-engine rename before publishing metadata, with a regression that reads the resulting table in Java.
The 170 pure Python and 18 Rust SQLContext tests passed. This case differs from the previously reported control-character cases because the base Java read succeeds.
Thanks for the reviewing & reproduction. PyPaimon now preserves the existing Java sequence field binding by field ID when rewriting I added an end-to-end regression that writes and alters the table in PyPaimon, then reads it through the Java reader. It checks that Java returns |
Purpose
Fixes #11633
With
sequence.field='t0, ts', renamingtstostampin PyPaimon's filesystem catalog can leave the option pointing tots. 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,stampand keeps the originaltscolumn as the tie-breaker, even if another column becomests. ASETthat 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 ist0,and an existing empty-named column is renamed tostamp, the catalog storest0,stampto preserve the SQLContext ordering.Tests
SETbehavior, trailing separators, and empty or control-character column names.pypaimon-rust 0.5.0(19 tests).