Skip to content

[improvement] Guard schema changes against live Global Index references (#9419) - #9438

Open
zhang-arvin wants to merge 1 commit into
apache:masterfrom
zhang-arvin:fix/9419-global-index-schema-guard
Open

[improvement] Guard schema changes against live Global Index references (#9419)#9438
zhang-arvin wants to merge 1 commit into
apache:masterfrom
zhang-arvin:fix/9419-global-index-schema-guard

Conversation

@zhang-arvin

Copy link
Copy Markdown
Contributor

Purpose

This PR adds a guard in SchemaManager that prevents schema changes (specifically DropColumn) from being applied when the column is referenced by a live Global Index.

Problem

Currently, schema changes like dropping a column can proceed even when Global Indexes defined on that column exist. This leads to inconsistent index state and potential data corruption.

Solution

Added checkGlobalIndexConflicts method in SchemaManager that:

  1. Scans table options for global-index entries to extract indexed column names
  2. Before applying schema changes, checks if any DropColumn targets a Global Index column
  3. Throws UnsupportedOperationException with a clear message directing users to drop the Global Index first

Testing

  • Compilation verified: mvn compile -pl paimon-core -am -DskipTests passes

Related Issue

Closes #9419

…es (apache#9419)

Signed-off-by: zhang-arvin <arvin.zhang@htx-inc.com>
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.

[Bug] Guard schema changes against live Global Index references

1 participant