Repository navigation
Conversation
Promoted child types change Field equality, leaving the lookup cache keyed by the old schema. Rebuild the cache when the schema changes so Field-based lookups and JSON serialization resolve the current vectors. Generated-by: Codex and DeepSeek
… in VectorSchemaRoot JsonFileWriter and JsonFileReader look each vector up by position, so columns with equal Fields no longer share one vector. The Field lookup keeps the first of such columns, as getVector(String) documents, and syncSchema() keeps the custom metadata of the schema. Also addresses review comments on apache#1389: the constructor and syncSchema() share the code that builds the lookup, and the JSON round trip after a schema sync moved to TestJSONFile. Closes apache#1473.
jbonofre
requested review from
laurentgo,
lidavidm and
wgtmac
as code owners
November 14, 2026 08:05
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.
What's Changed
Follow-up to #1389, which this PR is based on: until #1389 is merged, only the last commit is new.
JsonFileWriterandJsonFileReaderlook each vector up by position instead of throughgetVector(Field), so columns with equal Fields (such as duplicate names with the same type) no longer share one vector. A JSON round trip ofx: [1], x: [2]read backx: [null], x: [2]before.VectorSchemaRootkeeps the first of the columns with equal Fields, asgetVector(String)documents, instead of the last.syncSchema()keeps the custom metadata of the schema.syncSchema()share the code that builds the lookup, the comments say the old keys no longer match because the promoted Field is structurally different, an assertion that could not fail is dropped, and the JSON round trip after a schema sync moved toTestJSONFile.TestJSONFilecovers a JSON round trip of duplicate columns through bothread()andread(VectorSchemaRoot), andTestVectorSchemaRootcovers the lookup of duplicate columns and the metadata aftersyncSchema().Closes #1473.