From 56e216782acf68f964c635abc1084b28d802d641 Mon Sep 17 00:00:00 2001 From: amory Date: Thu, 8 Aug 2024 17:43:40 +0800 Subject: [PATCH] [Improve](config)del array config for create inverted index (#39006) ## Proposed changes delete useless config : enable_create_inverted_index_for_array --- .../java/org/apache/doris/common/Config.java | 3 -- .../org/apache/doris/analysis/IndexDef.java | 4 --- .../plans/commands/info/IndexDefinition.java | 4 --- ..._array_contains_with_inverted_index.groovy | 1 - .../inverted_index_p0/test_array_index.groovy | 30 ------------------- ..._array_with_inverted_index_all_type.groovy | 1 - .../mysql_fulltext_array_contains/load.groovy | 1 - 7 files changed, 44 deletions(-) diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java index 21a0694e4096e3..24c9cf069c042e 100644 --- a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java +++ b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java @@ -2837,9 +2837,6 @@ public static int metaServiceRpcRetryTimes() { @ConfField(mutable = true, masterOnly = true) public static boolean enable_create_bitmap_index_as_inverted_index = true; - @ConfField(mutable = true) - public static boolean enable_create_inverted_index_for_array = false; - // The original meta read lock is not enough to keep a snapshot of partition versions, // so the execution of `createScanRangeLocations` are delayed to `Coordinator::exec`, // to help to acquire a snapshot of partition versions. diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/IndexDef.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/IndexDef.java index 386a244c9344ba..7db8c460b2f674 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/IndexDef.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/IndexDef.java @@ -22,7 +22,6 @@ import org.apache.doris.catalog.KeysType; import org.apache.doris.catalog.PrimitiveType; import org.apache.doris.common.AnalysisException; -import org.apache.doris.common.Config; import com.google.common.base.Strings; import com.google.common.collect.Lists; @@ -238,9 +237,6 @@ public void checkColumn(Column column, KeysType keysType, boolean enableUniqueKe } if (indexType == IndexType.INVERTED) { - if (!Config.enable_create_inverted_index_for_array && colType.isArrayType()) { - throw new AnalysisException("inverted index does not support array type column:" + indexColName); - } InvertedIndexUtil.checkInvertedIndexParser(indexColName, colType, properties); } else if (indexType == IndexType.NGRAM_BF) { if (colType != PrimitiveType.CHAR && colType != PrimitiveType.VARCHAR diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/IndexDefinition.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/IndexDefinition.java index 79b781d2527d36..bd37616ea2d957 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/IndexDefinition.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/IndexDefinition.java @@ -23,7 +23,6 @@ import org.apache.doris.catalog.Env; import org.apache.doris.catalog.Index; import org.apache.doris.catalog.KeysType; -import org.apache.doris.common.Config; import org.apache.doris.nereids.exceptions.AnalysisException; import org.apache.doris.nereids.types.ArrayType; import org.apache.doris.nereids.types.DataType; @@ -124,9 +123,6 @@ public void checkColumn(ColumnDefinition column, KeysType keysType, } if (indexType == IndexType.INVERTED) { - if (!Config.enable_create_inverted_index_for_array && colType.isArrayType()) { - throw new AnalysisException("inverted index does not support array type column: " + indexColName); - } try { InvertedIndexUtil.checkInvertedIndexParser(indexColName, colType.toCatalogDataType().getPrimitiveType(), properties); diff --git a/regression-test/suites/inverted_index_p0/test_array_contains_with_inverted_index.groovy b/regression-test/suites/inverted_index_p0/test_array_contains_with_inverted_index.groovy index a401aee1e50e2d..0ea18c784d6340 100644 --- a/regression-test/suites/inverted_index_p0/test_array_contains_with_inverted_index.groovy +++ b/regression-test/suites/inverted_index_p0/test_array_contains_with_inverted_index.groovy @@ -18,7 +18,6 @@ suite("test_array_contains_with_inverted_index"){ // prepare test table def indexTblName = "tai" - sql """ ADMIN SET FRONTEND CONFIG ("enable_create_inverted_index_for_array" = "true"); """ // If we use common expr pass to inverted index , we should set enable_common_expr_pushdown = true sql """ set enable_common_expr_pushdown = true; """ diff --git a/regression-test/suites/inverted_index_p0/test_array_index.groovy b/regression-test/suites/inverted_index_p0/test_array_index.groovy index 38dee1c0952a40..7d10784b420430 100644 --- a/regression-test/suites/inverted_index_p0/test_array_index.groovy +++ b/regression-test/suites/inverted_index_p0/test_array_index.groovy @@ -15,33 +15,6 @@ // specific language governing permissions and limitations // under the License. -suite("test_array_index0"){ - // create without set config 'enable_create_inverted_index_for_array' = 'true' - try { - sql """ - CREATE TABLE `disable_create_inverted_idx_on_array` ( - `apply_date` date NULL COMMENT '', - `id` varchar(60) NOT NULL COMMENT '', - `inventors` array NULL COMMENT '', - INDEX index_inverted_inventors(inventors) USING INVERTED COMMENT '' - ) ENGINE=OLAP - DUPLICATE KEY(`apply_date`, `id`) - COMMENT 'OLAP' - DISTRIBUTED BY HASH(`id`) BUCKETS 1 - PROPERTIES ( - "replication_allocation" = "tag.location.default: 1", - "is_being_synced" = "false", - "storage_format" = "V2", - "light_schema_change" = "true", - "disable_auto_compaction" = "false", - "enable_single_replica_compaction" = "false" - ); - """ - } catch (Exception e) { - assertTrue(e.getMessage().contains("inverted index does not support array type column")) - } -} - suite("test_array_index1"){ // prepare test table @@ -50,8 +23,6 @@ suite("test_array_index1"){ def alter_res = "null" def useTime = 0 - sql """ ADMIN SET FRONTEND CONFIG ("enable_create_inverted_index_for_array" = "true"); """ - def wait_for_latest_op_on_table_finish = { table_name, OpTimeout -> for(int t = delta_time; t <= OpTimeout; t += delta_time){ alter_res = sql """SHOW ALTER TABLE COLUMN WHERE TableName = "${table_name}" ORDER BY CreateTime DESC LIMIT 1;""" @@ -124,7 +95,6 @@ suite("test_array_index2"){ def useTime = 0 def indexTblName = "test_array_index2" - sql """ ADMIN SET FRONTEND CONFIG ("enable_create_inverted_index_for_array" = "true"); """ sql "DROP TABLE IF EXISTS ${indexTblName}" // create 1 replica table diff --git a/regression-test/suites/inverted_index_p0/test_array_with_inverted_index_all_type.groovy b/regression-test/suites/inverted_index_p0/test_array_with_inverted_index_all_type.groovy index 05f0eb2176ad35..b895b97fe8e4f9 100644 --- a/regression-test/suites/inverted_index_p0/test_array_with_inverted_index_all_type.groovy +++ b/regression-test/suites/inverted_index_p0/test_array_with_inverted_index_all_type.groovy @@ -16,7 +16,6 @@ // under the License. suite("test_array_with_inverted_index_all_type"){ - sql """ ADMIN SET FRONTEND CONFIG ("enable_create_inverted_index_for_array" = "true"); """ // 1. mor|dup|mow // 2. index with english or standard parser (only string | variant type support english parser now) // 3. all types diff --git a/regression-test/suites/mysql_fulltext_array_contains/load.groovy b/regression-test/suites/mysql_fulltext_array_contains/load.groovy index 2ae48798243690..4e94553259b782 100644 --- a/regression-test/suites/mysql_fulltext_array_contains/load.groovy +++ b/regression-test/suites/mysql_fulltext_array_contains/load.groovy @@ -16,7 +16,6 @@ // under the License. suite("load") { - sql """ ADMIN SET FRONTEND CONFIG ("enable_create_inverted_index_for_array" = "true"); """ def test_basic_tables=["articles_uk_array", "articles_dk_array"] def test_fulltext_tables=["fulltext_t1_uk_array", "fulltext_t1_dk_array"]