fix: field name mismatch when alter table rename caused by FieldMappingReader#274
Merged
Merged
Conversation
7210f68 to
d3389f9
Compare
lszskye
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
The check does not consider column name change. When a user does pure ALTER TABLE RENAME COLUMN with no other schema change:
All four flag conditions evaluate to false → need_mapping_ = false → PASSTHRU.
The inner reader (e.g. paimon-cpp builtin parquet reader) emits the batch with the file's physical column name (age). The consumer (e.g. StarRocks BE) then looks up columns by their post-rename logical name
(years) using RecordBatch::GetColumnByName and gets a null shared_ptr. A subsequent member access on the null array dereferences nullptr → SIGSEGV.
This was missed by the existing TestAppendReadWithSchemaEvolution integration tests because they always combine RENAME with ADD COLUMN, which independently forces need_mapping_ = true via
non_exist_field_info_.
Tests
Added FieldMappingReaderTest.TestReadWithSchemaEvolutionPureRename:
Without the fix this test fails (Equals returns false due to field name mismatch).
API and Format
Documentation
Generative AI tooling
opus 4.7