hello-stephen commented on code in PR #71130:
URL: https://github.com/apache/doris/pull/71130#discussion_r4733807808


##########
fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java:
##########
@@ -2740,6 +2752,9 @@ public int getAsInt() {
                 // For light index changes, directly modify table metadata 
first.
                 modifyTableLightSchemaChange(rawSql, db, olapTable, 
indexSchemaMap, newIndexes,
                         alterIndexes, isDropIndex, jobId, false, propertyMap);
+                if (!indexesToBuild.isEmpty()) {
+                    submitBuildJobs(db, olapTable, indexSchemaMap, 
indexesToBuild);

Review Comment:
   [P2] Apply BUILD INDEX's VARIANT-column checks before publishing metadata
   
   On a local SNII table with existing data and a `VARIANT v` column, `ADD 
INDEX i(v) USING INVERTED PROPERTIES ('parser'='english') BUILD IMMEDIATE` 
reaches this call. This direct submission bypasses the explicit `BUILD INDEX` 
branch's VARIANT-column rejection at lines 2625–2636. The backend's 
`IndexBuilder::_build_snii_indexes_for_segment` rejects the root VARIANT 
through `IndexColumnWriter::check_support_inverted_index`, so the accepted 
ALTER installs the index but its backfill job fails and is eventually 
cancelled, leaving historical data unindexed. Reuse those column preconditions 
before the light metadata update, or select a supported rewrite path, and cover 
an ordinary VARIANT index separately from the values-index tests.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to