Skip to content

Creating a conflicting global index over a primary column succeeds at DDL and then breaks index-backed reads #10273

Description

@LuciferYang

Search before asking

  • I searched in the issues and found no similar issues.

Paimon version

master (1.5-SNAPSHOT)

Compute Engine

Flink and Spark (the create_global_index procedure).

Minimal reproduce step

  1. Build a global index over a primary-key column, e.g. a single-column index on vec, via sys.create_global_index.
  2. Build a second global index over vec plus another column (vec, txt) — same primary column, different column set.
  3. Run any index-backed read.

What doesn't meet your expectations?

The second create succeeds and commits index files, but any later index-backed read builds DataEvolutionGlobalIndexScanner, whose groupIndexFiles throws Primary field %s owns multiple indexes with different columns .... So an accepted DDL leaves the table in a state where the index-backed queries the index exists to serve are broken until the extra index is dropped by hand. The conflicting create should be rejected at DDL time instead.

Anything else?

A second create with the same column set is the refresh flow and must stay allowed. The rejection has to be type-agnostic, matching the read-side grouping by indexFieldId, so a conflicting index of a different type over the same primary column is caught too.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions