LuciferYang opened a new pull request, #10274:
URL: https://github.com/apache/paimon/pull/10274

   ### Purpose
   
   Creating a global index over a primary-key column that already has a global 
index with a different column set was accepted at DDL and committed index 
files. Any later index-backed read then builds 
`DataEvolutionGlobalIndexScanner`, whose `groupIndexFiles` throws `Primary 
field %s owns multiple indexes with different columns ...`, so an accepted 
create leaves the table in a state where its index-backed queries are broken 
until the extra index is dropped by hand.
   
   This rejects the conflicting create up front: 
`GlobalIndexBuilderUtils.checkPrimaryFieldNotIndexed` is wired into the Flink 
and Spark `CreateGlobalIndexProcedure`, so the DDL boundary rejects exactly 
what the read path cannot tolerate. A create with the same column set is the 
refresh flow and stays allowed. The check scans all index types 
(`Filter.alwaysTrue()`), matching the read-side grouping by `indexFieldId`, so 
a conflicting index of a different type over the same primary column is caught 
as well.
   
   This closes #10273.
   
   ### Tests
   
   - `GlobalIndexBuilderUtilsTest#testCheckPrimaryFieldNotIndexed` pins the 
decision: a different column set over the same primary column is rejected, 
while the same column set (refresh) and an unrelated column are allowed.
   
   ### API and Format
   
   No.
   
   ### Documentation
   
   No.
   


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