github-actions[bot] commented on code in PR #63147:
URL: https://github.com/apache/doris/pull/63147#discussion_r3220448905
##########
fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java:
##########
@@ -2522,9 +2527,25 @@ public int getAsInt() {
}
lightSchemaChange = false;
- // ngram_bf index can do light_schema_change in both local
and cloud mode
- // inverted index and ann index can only do
light_schema_change in local mode
- if
(index.isLightAddIndexSupported(enableAddIndexForNewData)) {
+ if (isVariantFieldPatternIndex(index, olapTable)) {
+ if (alterOps.size() != 1) {
+ throw new DdlException("Variant field pattern
index can not be mixed with other alter ops");
+ }
+ if (!enableAddIndexForNewData) {
+ throw new DdlException("Variant field pattern
index only supports adding index for "
+ + "new data. Please set
enable_add_index_for_new_data = true");
+ }
+ if (!Config.enable_light_index_change) {
+ throw new DdlException("Variant field pattern
index requires light index change");
+ }
+ // Variant field_pattern indexes are new-rowset
metadata changes; historical rowsets keep the
+ // existing fallback path, so parser indexes do not
need a cloud physical build job here.
+ alterIndexes.add(index);
+ isDropIndex = false;
Review Comment:
This makes `ALTER TABLE ... CREATE INDEX` accept variant `field_pattern`
indexes, but the normal full-table `DROP INDEX` path still rejects every index
with `field_pattern` in `processDropIndex` (`Can not drop index with field
pattern`). That means a user can create `idx_content` through this new path and
then has no supported way to remove it; the new regression only checks
partition drop rejection and does not cover full drop. Please allow full-table
drop for these metadata indexes (keeping partition drop rejected if needed) and
add a regression test for create followed by `drop index idx_content on
<table>`.
--
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]