airborne12 commented on code in PR #71130:
URL: https://github.com/apache/doris/pull/71130#discussion_r4733891801


##########
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:
   Confirmed and fixed in d56ed51bac1.
   
   A new FE UT, 
`SchemaChangeHandlerTest#testAddIndexBuildImmediateRejectsVariantColumn`, 
reproduced it on 17dae525c15: `ALTER TABLE ... ADD INDEX idx_v (v) USING 
INVERTED PROPERTIES ('parser' = 'english') BUILD IMMEDIATE` on a VARIANT column 
was accepted and would have submitted build jobs that BUILD INDEX itself 
rejects.
   
   Path resolution now applies the same VARIANT column rule as the BUILD INDEX 
branch, before any metadata changes. BUILD IMMEDIATE on such an index fails 
with `BUILD IMMEDIATE is not supported for index idx_v on VARIANT column v, 
because BUILD INDEX can not build it; use BUILD DEFERRED instead`, and the 
table keeps no index and no new jobs. The same test checks that BUILD DEFERRED 
still adds the index for new data. It is separate from the values-index tests.
   
   `SchemaChangeHandlerTest`, `VariantValuesIndexChangeTest` and 
`CloudIndexTest` pass (70 tests); the PR description now lists this case.
   



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