Skip to content

[core] Fix rewriting file index with multiple map keys of one column - #9669

Merged
JingsongLi merged 1 commit into
apache:masterfrom
jackylee-ch:fileindex-project-dedup
Sep 11, 2026
Merged

JingsongLi merged 1 commit into
apache:masterfrom
jackylee-ch:fileindex-project-dedup

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

Purpose

FileIndexOptions keys nested index entries by Column, nested name included, 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: Field names must be unique. Found duplicates: [m].

DataFileIndexWriter adds every nested key to one maintainer per map column, so the config is valid on write; only rewrite_file_index failed.

Tests

FileIndexProcessorTest.testProcessIndexesTwoKeysOfOneMapColumn, reading the rewritten index back to assert both keys survive.

Written with Claude Code; reasoning and verification are mine.

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 JingsongLi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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].

@JingsongLi
JingsongLi merged commit 8712ecd into apache:master Sep 11, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants