[improvement] Guard schema changes against live Global Index references (#9419) - #9438
[improvement] Guard schema changes against live Global Index references (#9419)#9438zhang-arvin wants to merge 1 commit into
Conversation
…es (apache#9419) Signed-off-by: zhang-arvin <arvin.zhang@htx-inc.com>
|
|
|
@JingsongLi Thanks for the review! You are right that the current implementation has limitations:
I would like to improve this to properly read the Index Manifest, but I need guidance on the correct API:
Regarding the CI failures — local compilation passes ([INFO] Scanning for projects... main: Could you advise on the preferred approach for reading the Index Manifest? I can update the PR accordingly. |
Purpose
This PR adds a guard in
SchemaManagerthat prevents schema changes (specificallyDropColumn) 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
checkGlobalIndexConflictsmethod inSchemaManagerthat:global-indexentries to extract indexed column namesDropColumntargets a Global Index columnUnsupportedOperationExceptionwith a clear message directing users to drop the Global Index firstTesting
mvn compile -pl paimon-core -am -DskipTestspassesRelated Issue
Closes #9419