From 6f37e483f8c0519cef3460b9cb4db42edc06729f Mon Sep 17 00:00:00 2001 From: amory Date: Wed, 7 Aug 2024 17:13:05 +0800 Subject: [PATCH] [improve](config)del useless creation config for inverted index (#39005) ## Proposed changes delete useless config : enable_create_inverted_index_for_array backport: https://github.com/apache/doris/pull/39006 Issue Number: close #xxx --- .../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 | 31 +------------------ .../test_array_inverted_index/load.groovy | 1 - ..._array_with_inverted_index_all_type.groovy | 1 - .../test_array_with_large_dataset.groovy | 1 - 8 files changed, 1 insertion(+), 45 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 e26f52413d..aef49960bf 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 @@ -2733,9 +2733,6 @@ public class Config extends ConfigBase { @ConfField(mutable = true) public static int cloud_cold_read_percent = 10; // 10% - @ConfField(mutable = true) - public static boolean enable_create_inverted_index_for_array = false; - @ConfField(mutable = true, masterOnly = true) public static boolean enable_create_bitmap_index_as_inverted_index = true; 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 386a244c93..7db8c460b2 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.Column; 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 class IndexDef { } 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 79b781d252..bd37616ea2 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.analysis.InvertedIndexUtil; 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 class IndexDefinition { } 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 d753d9c4b6..1364d3da82 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 bf23034d93..38eee6d405 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,7 +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){ @@ -122,7 +94,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 @@ -162,4 +133,4 @@ suite("test_array_index2"){ sql """ INSERT INTO `${indexTblName}`(`apply_date`, `id`, `inventors`) VALUES ('2019-01-01', '0974e7a82e30d1af83205e474fadd0a2', '[\"w\"]'); """ sql """ INSERT INTO `${indexTblName}`(`apply_date`, `id`, `inventors`) VALUES ('2019-01-01', '26823b3995ee38bd145ddd910b2f6300', '[\"x\"]'); """ sql """ INSERT INTO `${indexTblName}`(`apply_date`, `id`, `inventors`) VALUES ('2019-01-01', 'ee27ee1da291e46403c408e220bed6e1', '[\"y\"]'); """ -} \ No newline at end of file +} diff --git a/regression-test/suites/inverted_index_p0/test_array_inverted_index/load.groovy b/regression-test/suites/inverted_index_p0/test_array_inverted_index/load.groovy index b0d848a7d4..d4f79dba62 100644 --- a/regression-test/suites/inverted_index_p0/test_array_inverted_index/load.groovy +++ b/regression-test/suites/inverted_index_p0/test_array_inverted_index/load.groovy @@ -17,7 +17,6 @@ suite("load") { - sql """ ADMIN SET FRONTEND CONFIG ("enable_create_inverted_index_for_array" = "true"); """ sql """ DROP TABLE IF EXISTS table_200_undef_partitions2_keys3_properties4_distributed_by521; """ sql """ CREATE TABLE IF NOT EXISTS table_200_undef_partitions2_keys3_properties4_distributed_by521 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 da133f192f..81665829e8 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/inverted_index_p2/test_array_with_large_dataset.groovy b/regression-test/suites/inverted_index_p2/test_array_with_large_dataset.groovy index 92c3d97417..febec48793 100644 --- a/regression-test/suites/inverted_index_p2/test_array_with_large_dataset.groovy +++ b/regression-test/suites/inverted_index_p2/test_array_with_large_dataset.groovy @@ -54,7 +54,6 @@ suite("test_array_with_large_dataset", "p2"){ } // create table - sql """ ADMIN SET FRONTEND CONFIG ("enable_create_inverted_index_for_array" = "true"); """ sql """ DROP TABLE IF EXISTS bai;""" sql """ CREATE TABLE `bai` (