Repository navigation
Conversation
9ca1442 to
3c4c71b
Compare
JingsongLi
left a comment
There was a problem hiding this comment.
Rejecting blank names prevents Rust from publishing schemas that Java rejects. I ran 5,753 core, DataFusion, and SQLContext tests on 3c4c71be integrated with main 2456fee3. A separate write, commit, read, and ALTER probe reproduced the compatibility regression below.
| ), | ||
| }); | ||
| } | ||
| validate_non_blank_field_names(fields)?; |
There was a problem hiding this comment.
[P2] Keep unrelated ALTERs available for tables with legacy nested names. I wrote a Parquet row with payload ROW<"" INT> and value 42 on main. Both builds read 42, and updating snapshot.num-retained.max succeeds on main. The same property change on this head returns the new blank-name error. Batched RenameColumn works for top-level names, while the catalog rejects nested rename. An ID-preserving type change through the Rust API recovered the stored value. The existing DataFusion ALTER COLUMN ... SET DATA TYPE STRUCT<value INT> path assigns a new child ID and returned NULL for the stored value in the same test. Please reject newly introduced or renamed blank fields during ALTER and allow unchanged legacy field IDs to pass, so existing tables remain maintainable while users repair their schemas.
There was a problem hiding this comment.
Thanks for reviewing. I addressed this in new commit. ALTER now allows a legacy blank field name when both the field ID and the name are unchanged. It still rejects adding a field with a blank name or renaming a field to a blank name.
I verified that updating snapshot.num-retained.max succeeds on the legacy table with payload ROW<"" INT> and that the existing Parquet value still reads back as 42. I also verified that correcting the nested name while preserving its field ID keeps the value readable.
Purpose
Closes #1582
Reject empty and whitespace-only column names before CREATE or ALTER publishes a schema, while keeping previously saved tables readable and allowing invalid names to be corrected.
Brief change log
Tests
cargo fmt --all --checkandgit diff --checkpassed.API and Format
No API signature or storage format changes. CREATE and ALTER now reject blank field names, including nested fields. Reading existing schemas remains unchanged.
ALTER validates the complete resulting schema: a legacy table with multiple invalid names must correct all of them in one ALTER; unrelated ALTERs are rejected until those names are corrected. Batch correction and subsequent reads are covered by the existing-data checks.
Documentation
No documentation changes.