This is an automated email from the ASF dual-hosted git repository.

plat1ko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new c8c689714d0 add config enable_create_bitmap_index_as_inverted_index 
(#33434)
c8c689714d0 is described below

commit c8c689714d0c9907752c7b80646242780982e06e
Author: Kang <kxiao.ti...@gmail.com>
AuthorDate: Tue Apr 9 21:04:14 2024 +0800

    add config enable_create_bitmap_index_as_inverted_index (#33434)
---
 fe/fe-common/src/main/java/org/apache/doris/common/Config.java     | 3 +++
 fe/fe-core/src/main/cup/sql_parser.cup                             | 7 ++++++-
 .../java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java   | 3 ++-
 3 files changed, 11 insertions(+), 2 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 bc478f43864..20ac31289b5 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
@@ -2632,6 +2632,9 @@ public class Config extends ConfigBase {
     @ConfField(mutable = true, masterOnly = true)
     public static boolean enable_light_index_change = true;
 
+    @ConfField(mutable = true, masterOnly = true)
+    public static boolean enable_create_bitmap_index_as_inverted_index = 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/cup/sql_parser.cup 
b/fe/fe-core/src/main/cup/sql_parser.cup
index ac623e39ff4..08b793c4352 100644
--- a/fe/fe-core/src/main/cup/sql_parser.cup
+++ b/fe/fe-core/src/main/cup/sql_parser.cup
@@ -48,6 +48,7 @@ import org.apache.doris.catalog.StructType;
 import org.apache.doris.catalog.TableIf.TableType;
 import org.apache.doris.catalog.View;
 import org.apache.doris.common.AnalysisException;
+import org.apache.doris.common.Config;
 import org.apache.doris.common.FeConstants;
 import org.apache.doris.common.Version;
 import org.apache.doris.cloud.analysis.UseCloudClusterStmt;
@@ -3881,7 +3882,11 @@ opt_index_type ::=
     :}
     | KW_USING KW_BITMAP
     {:
-        RESULT = IndexDef.IndexType.INVERTED;
+        if (Config.enable_create_bitmap_index_as_inverted_index) {
+            RESULT = IndexDef.IndexType.INVERTED;
+        } else {
+            RESULT = IndexDef.IndexType.BITMAP;
+        }
     :}
     | KW_USING KW_NGRAM_BF
     {:
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
index 874b6a0d432..793cc9e258f 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
@@ -2625,7 +2625,8 @@ public class LogicalPlanBuilder extends 
DorisParserBaseVisitor<Object> {
         String indexType = ctx.indexType != null ? 
ctx.indexType.getText().toUpperCase() : null;
         String comment = ctx.comment != null ? ctx.comment.getText() : "";
         // change BITMAP index to INVERTED index
-        if ("BITMAP".equalsIgnoreCase(indexType)) {
+        if (Config.enable_create_bitmap_index_as_inverted_index
+                && "BITMAP".equalsIgnoreCase(indexType)) {
             indexType = "INVERTED";
         }
         return new IndexDefinition(indexName, indexCols, indexType, 
properties, comment);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to