[core] Fix rewriting file index with multiple map keys of one column - #9669
Merged
Merged
Conversation
FileIndexOptions keys nested index entries by Column, which includes the nested name, so m[k1] and m[k2] are two entries reporting the same top level column m. FileIndexProcessor collected that name once per entry into a list, so the projection carried m twice and RowType.project rejected it with "Field names must be unique. Found duplicates: [m]". DataFileIndexWriter already keys its maintainer by the top level column and adds each nested key to it, so the configuration is valid on write and only rewriting the index failed.
JingsongLi
reviewed
Sep 11, 2026
JingsongLi
left a comment
Contributor
There was a problem hiding this comment.
This fixes a valid rewrite_file_index workflow: m[k1] and m[k2] are separate index entries, but the data projection must include their common top-level map column only once. LinkedHashSet preserves first-seen projection order while the existing per-key/type maps still retain both nested indexes.
No blocking issue found. Both FileIndexProcessorTest cases pass with the changed class on JDK 8, including writing a real table, rewriting the index and reading back both m[k1] and m[k2].
XiaoHongbo-Hope
pushed a commit
that referenced
this pull request
Sep 20, 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
FileIndexOptionskeys nested index entries byColumn, nested name included, som[k1]andm[k2]are two entries reporting the same top level columnm.FileIndexProcessorcollected that name once per entry into a list, so the projection carriedmtwice andRowType.projectrejected it:Field names must be unique. Found duplicates: [m].DataFileIndexWriteradds every nested key to one maintainer per map column, so the config is valid on write; onlyrewrite_file_indexfailed.Tests
FileIndexProcessorTest.testProcessIndexesTwoKeysOfOneMapColumn, reading the rewritten index back to assert both keys survive.Written with Claude Code; reasoning and verification are mine.