Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2655,6 +2655,9 @@ public static boolean isNotCloudMode() {
@ConfField(mutable = true)
public static int cloud_cold_read_percent = 10; // 10%

@ConfField(mutable = true, masterOnly = true)
public static boolean enable_create_bitmap_index_as_inverted_index = true;

// 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.
Expand Down
7 changes: 6 additions & 1 deletion fe/fe-core/src/main/cup/sql_parser.cup
Original file line number Diff line number Diff line change
Expand Up @@ -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.mysql.MysqlPassword;
Expand Down Expand Up @@ -3844,7 +3845,11 @@ opt_index_type ::=
:}
| KW_USING KW_BITMAP
{:
RESULT = IndexDef.IndexType.BITMAP;
if (Config.enable_create_bitmap_index_as_inverted_index) {
RESULT = IndexDef.IndexType.INVERTED;
} else {
RESULT = IndexDef.IndexType.BITMAP;
}
:}
| KW_USING KW_NGRAM_BF
{:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2688,7 +2688,8 @@ public IndexDefinition visitIndexDef(IndexDefContext ctx) {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import org.codehaus.groovy.runtime.IOGroovyMethods

suite("test_index_ddl_fault_injection", "nonConcurrent") {
try {
// temporaryly disable enable_create_bitmap_index_as_inverted_index
sql "ADMIN SET FRONTEND CONFIG ('enable_create_bitmap_index_as_inverted_index' = 'false')"
sql "DROP TABLE IF EXISTS `test_index_ddl_fault_injection_tbl`"
sql """
CREATE TABLE test_index_ddl_fault_injection_tbl (
Expand Down Expand Up @@ -93,5 +95,7 @@ suite("test_index_ddl_fault_injection", "nonConcurrent") {
GetDebugPoint().disableDebugPointForAllBEs("BitmapIndexReader::new_iterator.fail");
}
} finally {
// restore enable_create_bitmap_index_as_inverted_index
sql "ADMIN SET FRONTEND CONFIG ('enable_create_bitmap_index_as_inverted_index' = 'true')"
}
}