Repository navigation
Do not remove another column's stream with a dropped marker column - #119115
alexey-milovidov wants to merge 7 commits into
Conversation
A column that a part records as a missing-column marker has no streams of its own, and the dropped name was looked up in the part's serializations. For a marker named like a subcolumn of another column (`a.size0` next to an `Array` column `a`) that name resolves to the subcolumn's serialization, so the mutation of a `DROP COLUMN` removed the array's offsets file from the new part and every read of the array failed with a logical error afterwards. The dropped column's serialization now comes from the part's own column entry, and a column the part holds no data for has no files to remove. This is the mutation-side sibling of the read side (issue #114588) and of the merge side, and takes the same shape as the merge-side fix. Closes: #118255
|
Workflow [PR], commit [a51c6b0] Summary: ❌
AI ReviewSummaryThis PR fixes the wide-part mutation path so a marker-only column is no longer resolved through the part's subcolumn-aware serialization lookup when Final Verdict✅ Approved LLVM Coverage ReportMeasured on commit a51c6b0.
Changed lines: Changed C/C++ lines covered: 14/14 (100.00%) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 23 s compile time in total, 7 of them have a recent master baseline. |
…subcolumn-name-118255
The wide-part `RENAME_COLUMN` fallback of `collectFilesForRenames` (the path for parts without `columns_substreams.txt`, which a missing-column marker is always absent from) looked the renamed column's serialization up in the part by name, exactly like the `DROP_COLUMN` branch did before. For a marker named like a subcolumn of another column (`a.size0` next to an `Array` column `a`) that lookup resolves to the array's offsets serialization. Both branches now go through one helper, `getSerializationOfPhysicalColumn`, that returns the serialization from the part's own column entry and nothing for a column the part holds no data for: such a column has no stream files to remove or rename. Add `05228_rename_marker_column_named_like_subcolumn` for the rename side (`Array` and `Nested`, plus a physically written column of the same name), and renumber the drop test to `05227` because `05177` is taken on master now. Addresses the review thread #119115 (comment) Co-Authored-By: Claude Fable 5.1 <[email protected]>
…subcolumn-name-118255
The `RENAME_COLUMN` fallback computes the target by replacing the escaped column name (`a%2Esize0`) in the stream file name, which the array's offsets file (`a.size0`) does not contain, so the pre-fix code emitted no rename for the tested shapes. The shapes where the escaped name does match (a marker `t.x` next to `t Tuple(x ...)`) are rejected by the stream file name collision check on `ADD COLUMN` (verified on a pre-fix binary), so no case can fail before the fix. Reword the test header to say it pins the invariant. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
🕵 Closing as already fixed on master. The same issue (#118255) was fixed by #118246 (commit To verify, I took master's |
With
skip_empty_columns_on_insert = 1andserialization_info_version = 'with_missing_columns', anINSERTthat leaves a column at its type default records it as a missing-column marker instead of writing stream files.ALTER TABLE ... DROP COLUMNof such a marker named like a generated subcolumn of another column - a column nameda.size0next to anArraycolumna- removed the array's offsets stream from the mutated part, and every subsequent read ofafailed with a logical error:The wide-part
DROP_COLUMNbranch ofcollectFilesForRenameslooked the dropped name up through the part's serializations. The marker column has no serialization of its own there, so the name resolved to the serialization of the array'sa.size0subcolumn and the stream enumerated from it was the array's offsets file; the shared-stream counter reached zero because the marker contributed no streams of its own, and the mutation removed the file.The dropped column's serialization now comes from the part's own column entry, and a column the part holds no data for has no files to remove at all. The wide-part
RENAME_COLUMNfallback for parts withoutcolumns_substreams.txtdid the same name lookup, so both branches go through one helper that skips stream enumeration for such a column. On the rename side this is defensive: the fallback computes the target by replacing the escaped column name (a%2Esize0), which the offsets file (a.size0) does not contain, and the shapes where it would match are rejected by the stream file name collision check onADD COLUMN; the second test pins the invariant rather than a live corruption. This is the mutation-side sibling of the read side (#114588) and the merge side; the fix has the same shape as the merge one.Closes: #118255
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fixed
ALTER TABLE ... DROP COLUMNof a column that a part records as a missing-column marker deleting another column's stream from the mutated part when the dropped column is named like a subcolumn of that column, such asa.size0next to anArraycolumna. Reads of the array failed with a logical error afterwards.Workflow [PR]
Sync PR [sync-upstream/pr/119115]