Skip to content

Commit

Permalink
[Improve](config)del array config for create inverted index (apache#3…
Browse files Browse the repository at this point in the history
…9006)

## Proposed changes
delete useless config : enable_create_inverted_index_for_array
  • Loading branch information
amorynan authored Aug 8, 2024
1 parent 2ea5aab commit a6b8a94
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; """
Expand Down
30 changes: 0 additions & 30 deletions regression-test/suites/inverted_index_p0/test_array_index.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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<text> 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

Expand All @@ -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;"""
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down

0 comments on commit a6b8a94

Please sign in to comment.