JingsongLi commented on PR #9438:
URL: https://github.com/apache/paimon/pull/9438#issuecomment-5534786008

   The current head still does not protect the case from #9419. Standard Global 
Index definitions live in the latest snapshot's index manifest, not in 
`schema.options()`, so this option parser normally leaves `indexedFieldNames` 
empty and the DROP COLUMN proceeds.
   
   There is already an established API path you can reuse:
   
   1. Build the branch-specific `FileStoreTable` for 
`fileIO/tableRoot/oldTableSchema` (and switch to `branch`).
   2. Resolve its latest snapshot.
   3. Call `table.store().newIndexFileHandler().scan(snapshot, filter)`.
   4. Keep entries whose `entry.indexFile().globalIndexMeta() != null`, and 
resolve the indexed fields from `GlobalIndexMeta` against `table.rowType()`.
   
   `MergeIntoUpdateChecker#checkUpdatedColumns` and `DropGlobalIndexProcedure` 
are concrete examples of this exact scan. Please do not swallow manifest-read 
failures here: this guard must fail closed, because continuing the schema 
commit is precisely what leaves live index metadata referring to a dropped 
field.
   
   The regression test should create/commit a real Global Index, verify 
dropping an indexed column is rejected, then drop the index and verify the 
schema change succeeds. Parsing a synthetic option would not exercise the 
production metadata path. Also, the current diff still fails `git diff --check` 
on two trailing-whitespace lines.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to