This is an automated email from the ASF dual-hosted git repository.
kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new a557fed4120 [fix](inverted index) disallow inverted index with parser
for value columns of MOR unique table (#31054)
a557fed4120 is described below
commit a557fed4120f101cc914c57b4f52dd52c859b093
Author: Kang <[email protected]>
AuthorDate: Sun Feb 18 20:38:55 2024 +0800
[fix](inverted index) disallow inverted index with parser for value columns
of MOR unique table (#31054)
---
.../java/org/apache/doris/analysis/IndexDef.java | 13 +++--
.../test_segcompaction_unique_keys_index.out | 9 ++++
.../decimalv2/test_decimalv2_common.groovy | 4 +-
.../suites/index_p0/test_bitmap_index.groovy | 15 +++++-
.../inverted_index_p0/test_bitmap_index.groovy | 6 ++-
.../inverted_index_p0/test_build_index.groovy | 1 +
.../test_inverted_index_mor.groovy | 19 +++++++-
.../load_p0/broker_load/ddl/uniq_tbl_basic.sql | 8 +++-
.../load_p0/broker_load/test_seq_load.groovy | 8 +++-
.../routine_load/ddl/uniq_tbl_basic_create.sql | 8 +++-
.../stream_load/ddl/uniq_tbl_basic_create.sql | 8 +++-
.../ddl/uniq_tbl_basic_create_sequence.sql | 8 +++-
.../suites/load_p0/tvf/ddl/uniq_tbl_basic_tvf.sql | 8 +++-
.../test_segcompaction_unique_keys_index.groovy | 55 +++++++++++++---------
14 files changed, 131 insertions(+), 39 deletions(-)
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 ee620572f6f..3a9298460ec 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
@@ -224,9 +224,16 @@ public class IndexDef {
throw new AnalysisException(colType + " is not supported in "
+ indexType.toString() + " index. "
+ "invalid index: " + indexName);
}
- if (!column.isKey() && keysType == KeysType.AGG_KEYS) {
- throw new AnalysisException("index should only be used in
columns of DUP_KEYS/UNIQUE_KEYS table"
- + " or key columns of AGG_KEYS table. invalid index: " +
indexName);
+ if (!column.isKey()) {
+ if (keysType == KeysType.AGG_KEYS) {
+ throw new AnalysisException("index should only be used in
columns of DUP_KEYS/UNIQUE_KEYS table"
+ + " or key columns of AGG_KEYS table. invalid index: "
+ indexName);
+ } else if (keysType == KeysType.UNIQUE_KEYS &&
!enableUniqueKeyMergeOnWrite
+ && indexType == IndexType.INVERTED &&
properties != null
+ &&
properties.containsKey(InvertedIndexUtil.INVERTED_INDEX_PARSER_KEY)) {
+ throw new AnalysisException("INVERTED index with parser
can NOT be used in value columns of"
+ + " UNIQUE_KEYS table with merge_on_write disable.
invalid index: " + indexName);
+ }
}
if (indexType == IndexType.INVERTED) {
diff --git
a/regression-test/data/segcompaction_p2/test_segcompaction_unique_keys_index.out
b/regression-test/data/segcompaction_p2/test_segcompaction_unique_keys_index.out
new file mode 100644
index 00000000000..80f1df28b54
--- /dev/null
+++
b/regression-test/data/segcompaction_p2/test_segcompaction_unique_keys_index.out
@@ -0,0 +1,9 @@
+-- This file is automatically generated. You should know what you did if you
want to edit this
+-- !select_default --
+
+-- !select_default --
+0
+
+-- !select_default --
+0
+
diff --git
a/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_common.groovy
b/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_common.groovy
index 23f7a8c2d79..64ad8ba8f08 100644
--- a/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_common.groovy
+++ b/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_common.groovy
@@ -60,8 +60,8 @@ suite("test_decimalv2_common", "nonConcurrent") {
`decimal_key2` decimalv2(16, 5) NULL COMMENT "",
`decimal_value1` decimalv2(8, 5) NULL COMMENT "",
`decimal_value2` decimalv2(16, 5) NULL COMMENT "",
- INDEX `idx_key1` (`decimal_key1`) USING BITMAP,
- INDEX `idx_key2` (`decimal_key2`) USING BITMAP
+ INDEX `idx_key1` (`decimal_value1`) USING BITMAP,
+ INDEX `idx_key2` (`decimal_value2`) USING BITMAP
) ENGINE=OLAP
UNIQUE KEY(`decimal_key1`, `decimal_key2`)
COMMENT "OLAP"
diff --git a/regression-test/suites/index_p0/test_bitmap_index.groovy
b/regression-test/suites/index_p0/test_bitmap_index.groovy
index 65f75e609a1..8d438dc6085 100644
--- a/regression-test/suites/index_p0/test_bitmap_index.groovy
+++ b/regression-test/suites/index_p0/test_bitmap_index.groovy
@@ -254,7 +254,12 @@ suite("test_bitmap_index") {
ADD INDEX index8 (k8) USING BITMAP,
ADD INDEX index9 (k9) USING BITMAP,
ADD INDEX index10 (k10) USING BITMAP,
- ADD INDEX index11 (k11) USING BITMAP;
+ ADD INDEX index11 (k11) USING BITMAP,
+ ADD INDEX index12 (k12) USING BITMAP,
+ ADD INDEX index13 (k13) USING BITMAP,
+ ADD INDEX index14 (k14) USING BITMAP,
+ ADD INDEX index15 (k15) USING BITMAP,
+ ADD INDEX index16 (v1) USING BITMAP;
"""
max_try_secs = 60
while (max_try_secs--) {
@@ -275,7 +280,7 @@ suite("test_bitmap_index") {
qt_sql "desc ${tbName3};"
show_result = sql "show index from ${tbName3}"
logger.info("show index from " + tbName3 + " result: " + show_result)
- assertEquals(show_result.size(), 11)
+ assertEquals(show_result.size(), 16)
assertEquals(show_result[0][2], "index1")
assertEquals(show_result[1][2], "index2")
assertEquals(show_result[2][2], "index3")
@@ -287,6 +292,11 @@ suite("test_bitmap_index") {
assertEquals(show_result[8][2], "index9")
assertEquals(show_result[9][2], "index10")
assertEquals(show_result[10][2], "index11")
+ assertEquals(show_result[11][2], "index12")
+ assertEquals(show_result[12][2], "index13")
+ assertEquals(show_result[13][2], "index14")
+ assertEquals(show_result[14][2], "index15")
+ assertEquals(show_result[15][2], "index16")
qt_sql "select * from ${tbName3};"
sql "DROP INDEX IF EXISTS index1 ON ${tbName3};"
@@ -349,6 +359,7 @@ suite("test_bitmap_index") {
"dynamic_partition.reserved_history_periods" = "NULL",
"dynamic_partition.storage_policy" = "",
"storage_format" = "V2",
+ "enable_unique_key_merge_on_write" = "false",
"light_schema_change" = "true",
"disable_auto_compaction" = "false",
"enable_single_replica_compaction" = "false"
diff --git a/regression-test/suites/inverted_index_p0/test_bitmap_index.groovy
b/regression-test/suites/inverted_index_p0/test_bitmap_index.groovy
index 2aff1060908..172abee9ee1 100644
--- a/regression-test/suites/inverted_index_p0/test_bitmap_index.groovy
+++ b/regression-test/suites/inverted_index_p0/test_bitmap_index.groovy
@@ -226,7 +226,8 @@ suite("test_bitmap_index", "inverted_index") {
ADD INDEX index8 (k8) USING BITMAP,
ADD INDEX index9 (k9) USING BITMAP,
ADD INDEX index10 (k10) USING BITMAP,
- ADD INDEX index11 (k11) USING BITMAP;
+ ADD INDEX index11 (k11) USING BITMAP,
+ ADD INDEX index12 (v1) USING BITMAP;
"""
max_try_secs = 60
while (max_try_secs--) {
@@ -247,7 +248,7 @@ suite("test_bitmap_index", "inverted_index") {
qt_sql "desc ${tbName3};"
show_result = sql "show index from ${tbName3}"
logger.info("show index from " + tbName3 + " result: " + show_result)
- assertEquals(show_result.size(), 11)
+ assertEquals(show_result.size(), 12)
assertEquals(show_result[0][2], "index1")
assertEquals(show_result[1][2], "index2")
assertEquals(show_result[2][2], "index3")
@@ -259,6 +260,7 @@ suite("test_bitmap_index", "inverted_index") {
assertEquals(show_result[8][2], "index9")
assertEquals(show_result[9][2], "index10")
assertEquals(show_result[10][2], "index11")
+ assertEquals(show_result[11][2], "index12")
qt_sql "select * from ${tbName3};"
sql "DROP INDEX IF EXISTS index1 ON ${tbName3};"
diff --git a/regression-test/suites/inverted_index_p0/test_build_index.groovy
b/regression-test/suites/inverted_index_p0/test_build_index.groovy
index 87250c2897b..aba929340b6 100644
--- a/regression-test/suites/inverted_index_p0/test_build_index.groovy
+++ b/regression-test/suites/inverted_index_p0/test_build_index.groovy
@@ -71,6 +71,7 @@ suite("test_build_index", "inverted_index"){
useTime = t
sleep(delta_time)
}
+ logger.info("wait_for_last_build_index_on_table_running debug: " +
alter_res)
assertTrue(useTime <= OpTimeout,
"wait_for_last_build_index_on_table_finish timeout")
return "wait_timeout"
}
diff --git
a/regression-test/suites/inverted_index_p0/test_inverted_index_mor.groovy
b/regression-test/suites/inverted_index_p0/test_inverted_index_mor.groovy
index 5e4562e08b1..1905067d433 100644
--- a/regression-test/suites/inverted_index_p0/test_inverted_index_mor.groovy
+++ b/regression-test/suites/inverted_index_p0/test_inverted_index_mor.groovy
@@ -34,8 +34,7 @@ suite("test_inverted_index_mor", "p0"){
`c_float` FLOAT,
`c_string` STRING,
INDEX idx_k2(`k2`) USING INVERTED COMMENT '',
- INDEX idx_c_int(`c_int`) USING INVERTED COMMENT '',
- INDEX idx_c_string(`c_string`) USING INVERTED
PROPERTIES("parser"="english") COMMENT ''
+ INDEX idx_c_int(`c_int`) USING INVERTED COMMENT ''
) ENGINE=OLAP
UNIQUE KEY(`k1`, `k2`)
COMMENT 'OLAP'
@@ -60,4 +59,20 @@ suite("test_inverted_index_mor", "p0"){
qt_21 """ SELECT * FROM $indexTblName ORDER BY k1,k2 """
qt_22 """ SELECT * FROM $indexTblName WHERE k2 > 2 OR c_int = 12 ORDER BY
k1,k2 """
qt_23 """ SELECT * FROM $indexTblName WHERE k2 > 2 OR c_int = 112 ORDER BY
k1,k2 """
+
+ // can not add INVERTED INDEX with parser
+ test{
+ sql """ ALTER TABLE ${indexTblName} ADD INDEX idx_c_string(`c_string`)
USING INVERTED PROPERTIES("parser"="english"); """
+ exception "errCode = 2, detailMessage = INVERTED index with parser can
NOT be used in value columns of UNIQUE_KEYS table with merge_on_write disable.
invalid index: idx_c_string"
+ }
+
+ // can add INVERTED INDEX without parser
+ def success = false;
+ try {
+ sql """ ALTER TABLE ${indexTblName} ADD INDEX idx_c_string(`c_string`)
USING INVERTED; """
+ success = true
+ } catch(Exception ex) {
+ logger.info("ALTER TABLE ${indexTblName} ADD INDEX idx_c_string
without parser exception: " + ex)
+ }
+ assertTrue(success)
}
\ No newline at end of file
diff --git a/regression-test/suites/load_p0/broker_load/ddl/uniq_tbl_basic.sql
b/regression-test/suites/load_p0/broker_load/ddl/uniq_tbl_basic.sql
index 560a9a78a3d..993e7046ec9 100644
--- a/regression-test/suites/load_p0/broker_load/ddl/uniq_tbl_basic.sql
+++ b/regression-test/suites/load_p0/broker_load/ddl/uniq_tbl_basic.sql
@@ -36,7 +36,13 @@ CREATE TABLE uniq_tbl_basic
kd15 CHAR(255) NOT NULL DEFAULT "我能吞下玻璃而不伤身体",
kd16 VARCHAR(300) NOT NULL DEFAULT "我能吞下玻璃而不伤身体",
kd17 STRING NOT NULL DEFAULT "我能吞下玻璃而不伤身体",
- kd18 JSON NULL
+ kd18 JSON NULL,
+
+ INDEX idx_bitmap_k104 (`k02`) USING BITMAP,
+ INDEX idx_bitmap_k110 (`kd01`) USING BITMAP,
+ INDEX idx_bitmap_k113 (`k13`) USING BITMAP,
+ INDEX idx_bitmap_k114 (`k14`) USING BITMAP,
+ INDEX idx_bitmap_k117 (`k17`) USING BITMAP
)
UNIQUE KEY(k00,k01)
PARTITION BY RANGE(k01)
diff --git a/regression-test/suites/load_p0/broker_load/test_seq_load.groovy
b/regression-test/suites/load_p0/broker_load/test_seq_load.groovy
index eca3074bfdb..a762d79e5c8 100644
--- a/regression-test/suites/load_p0/broker_load/test_seq_load.groovy
+++ b/regression-test/suites/load_p0/broker_load/test_seq_load.groovy
@@ -60,7 +60,13 @@ suite("test_seq_load", "load_p0") {
kd15 CHAR(255) NOT NULL DEFAULT "我能吞下玻璃而不伤身体",
kd16 VARCHAR(300) NOT NULL DEFAULT "我能吞下玻璃而不伤身体",
kd17 STRING NOT NULL DEFAULT "我能吞下玻璃而不伤身体",
- kd18 JSON NULL
+ kd18 JSON NULL,
+
+ INDEX idx_bitmap_k104 (`k02`) USING BITMAP,
+ INDEX idx_bitmap_k110 (`kd01`) USING BITMAP,
+ INDEX idx_bitmap_k113 (`k13`) USING BITMAP,
+ INDEX idx_bitmap_k114 (`k14`) USING BITMAP,
+ INDEX idx_bitmap_k117 (`k17`) USING BITMAP
)
UNIQUE KEY(k00,k01)
PARTITION BY RANGE(k01)
diff --git
a/regression-test/suites/load_p0/routine_load/ddl/uniq_tbl_basic_create.sql
b/regression-test/suites/load_p0/routine_load/ddl/uniq_tbl_basic_create.sql
index 38b9d267742..68a78e9b755 100644
--- a/regression-test/suites/load_p0/routine_load/ddl/uniq_tbl_basic_create.sql
+++ b/regression-test/suites/load_p0/routine_load/ddl/uniq_tbl_basic_create.sql
@@ -36,7 +36,13 @@ CREATE TABLE routine_load_uniq_tbl_basic
kd15 CHAR(255) NOT NULL DEFAULT "我能吞下玻璃而不伤身体",
kd16 VARCHAR(300) NOT NULL DEFAULT "我能吞下玻璃而不伤身体",
kd17 STRING NOT NULL DEFAULT "我能吞下玻璃而不伤身体",
- kd18 JSON NULL
+ kd18 JSON NULL,
+
+ INDEX idx_bitmap_k104 (`k02`) USING BITMAP,
+ INDEX idx_bitmap_k110 (`kd01`) USING BITMAP,
+ INDEX idx_bitmap_k113 (`k13`) USING BITMAP,
+ INDEX idx_bitmap_k114 (`k14`) USING BITMAP,
+ INDEX idx_bitmap_k117 (`k17`) USING BITMAP
)
UNIQUE KEY(k00,k01)
PARTITION BY RANGE(k01)
diff --git
a/regression-test/suites/load_p0/stream_load/ddl/uniq_tbl_basic_create.sql
b/regression-test/suites/load_p0/stream_load/ddl/uniq_tbl_basic_create.sql
index d6e4f5a8c48..44d6ff98b2e 100644
--- a/regression-test/suites/load_p0/stream_load/ddl/uniq_tbl_basic_create.sql
+++ b/regression-test/suites/load_p0/stream_load/ddl/uniq_tbl_basic_create.sql
@@ -36,7 +36,13 @@ CREATE TABLE stream_load_uniq_tbl_basic
kd15 CHAR(255) NOT NULL DEFAULT "我能吞下玻璃而不伤身体",
kd16 VARCHAR(300) NOT NULL DEFAULT "我能吞下玻璃而不伤身体",
kd17 STRING NOT NULL DEFAULT "我能吞下玻璃而不伤身体",
- kd18 JSON NULL
+ kd18 JSON NULL,
+
+ INDEX idx_bitmap_k104 (`k02`) USING BITMAP,
+ INDEX idx_bitmap_k110 (`kd01`) USING BITMAP,
+ INDEX idx_bitmap_k113 (`k13`) USING BITMAP,
+ INDEX idx_bitmap_k114 (`k14`) USING BITMAP,
+ INDEX idx_bitmap_k117 (`k17`) USING BITMAP
)
UNIQUE KEY(k00,k01)
PARTITION BY RANGE(k01)
diff --git
a/regression-test/suites/load_p0/stream_load/ddl/uniq_tbl_basic_create_sequence.sql
b/regression-test/suites/load_p0/stream_load/ddl/uniq_tbl_basic_create_sequence.sql
index 557db73feaf..4695b0fc2c8 100644
---
a/regression-test/suites/load_p0/stream_load/ddl/uniq_tbl_basic_create_sequence.sql
+++
b/regression-test/suites/load_p0/stream_load/ddl/uniq_tbl_basic_create_sequence.sql
@@ -36,7 +36,13 @@ CREATE TABLE stream_load_uniq_tbl_basic_sequence
kd15 CHAR(255) NOT NULL DEFAULT "我能吞下玻璃而不伤身体",
kd16 VARCHAR(300) NOT NULL DEFAULT "我能吞下玻璃而不伤身体",
kd17 STRING NOT NULL DEFAULT "我能吞下玻璃而不伤身体",
- kd18 JSON NULL
+ kd18 JSON NULL,
+
+ INDEX idx_bitmap_k104 (`k02`) USING BITMAP,
+ INDEX idx_bitmap_k110 (`kd01`) USING BITMAP,
+ INDEX idx_bitmap_k113 (`k13`) USING BITMAP,
+ INDEX idx_bitmap_k114 (`k14`) USING BITMAP,
+ INDEX idx_bitmap_k117 (`k17`) USING BITMAP
)
UNIQUE KEY(k00,k01)
DISTRIBUTED BY HASH(k00) BUCKETS 32
diff --git a/regression-test/suites/load_p0/tvf/ddl/uniq_tbl_basic_tvf.sql
b/regression-test/suites/load_p0/tvf/ddl/uniq_tbl_basic_tvf.sql
index d477f030289..8af1681fec8 100644
--- a/regression-test/suites/load_p0/tvf/ddl/uniq_tbl_basic_tvf.sql
+++ b/regression-test/suites/load_p0/tvf/ddl/uniq_tbl_basic_tvf.sql
@@ -36,7 +36,13 @@ CREATE TABLE uniq_tbl_basic_tvf
kd15 CHAR(255) NOT NULL DEFAULT "我能吞下玻璃而不伤身体",
kd16 VARCHAR(300) NOT NULL DEFAULT "我能吞下玻璃而不伤身体",
kd17 STRING NOT NULL DEFAULT "我能吞下玻璃而不伤身体",
- kd18 JSON NULL
+ kd18 JSON NULL,
+
+ INDEX idx_bitmap_k104 (`k02`) USING BITMAP,
+ INDEX idx_bitmap_k110 (`kd01`) USING BITMAP,
+ INDEX idx_bitmap_k113 (`k13`) USING BITMAP,
+ INDEX idx_bitmap_k114 (`k14`) USING BITMAP,
+ INDEX idx_bitmap_k117 (`k17`) USING BITMAP
)
UNIQUE KEY(k00,k01)
PARTITION BY RANGE(k01)
diff --git
a/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys_index.groovy
b/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys_index.groovy
index 3a9503ba723..eb39c48e0b7 100644
---
a/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys_index.groovy
+++
b/regression-test/suites/segcompaction_p2/test_segcompaction_unique_keys_index.groovy
@@ -48,28 +48,39 @@ suite("test_segcompaction_unique_keys_index") {
}
sql """ DROP TABLE IF EXISTS ${tableName} """
- test {
- sql """
- CREATE TABLE IF NOT EXISTS ${tableName} (
- `col_0` BIGINT NOT NULL,`col_1` VARCHAR(20),`col_2`
VARCHAR(20),`col_3` VARCHAR(20),`col_4` VARCHAR(20),
- `col_5` VARCHAR(20),`col_6` VARCHAR(20),`col_7`
VARCHAR(20),`col_8` VARCHAR(20),`col_9` VARCHAR(20),
- `col_10` VARCHAR(20),`col_11` VARCHAR(20),`col_12`
VARCHAR(20),`col_13` VARCHAR(20),`col_14` VARCHAR(20),
- `col_15` VARCHAR(20),`col_16` VARCHAR(20),`col_17`
VARCHAR(20),`col_18` VARCHAR(20),`col_19` VARCHAR(20),
- `col_20` VARCHAR(20),`col_21` VARCHAR(20),`col_22`
VARCHAR(20),`col_23` VARCHAR(20),`col_24` VARCHAR(20),
- `col_25` VARCHAR(20),`col_26` VARCHAR(20),`col_27`
VARCHAR(20),`col_28` VARCHAR(20),`col_29` VARCHAR(20),
- `col_30` VARCHAR(20),`col_31` VARCHAR(20),`col_32`
VARCHAR(20),`col_33` VARCHAR(20),`col_34` VARCHAR(20),
- `col_35` VARCHAR(20),`col_36` VARCHAR(20),`col_37`
VARCHAR(20),`col_38` VARCHAR(20),`col_39` VARCHAR(20),
- `col_40` VARCHAR(20),`col_41` VARCHAR(20),`col_42`
VARCHAR(20),`col_43` VARCHAR(20),`col_44` VARCHAR(20),
- `col_45` VARCHAR(20),`col_46` VARCHAR(20),`col_47`
VARCHAR(20),`col_48` VARCHAR(20),`col_49` VARCHAR(20),
- INDEX index_col_0 (`col_0`) USING INVERTED COMMENT '',
- INDEX index_col_1 (`col_1`) USING INVERTED
PROPERTIES("parser" = "english") COMMENT '',
- INDEX index_col_2 (`col_2`) USING INVERTED COMMENT ''
- )
- UNIQUE KEY(`col_0`) DISTRIBUTED BY HASH(`col_0`) BUCKETS 1
- PROPERTIES ( "replication_num" = "1" );
- """
- exception "index should only be used in columns of
DUP_KEYS/UNIQUE_KEYS table or key columns of AGG_KEYS table. invalid indexName:
index_col_1"
- }
+ sql """
+ CREATE TABLE IF NOT EXISTS ${tableName} (
+ `col_0` BIGINT NOT NULL,`col_1` VARCHAR(20),`col_2`
VARCHAR(20),`col_3` VARCHAR(20),`col_4` VARCHAR(20),
+ `col_5` VARCHAR(20),`col_6` VARCHAR(20),`col_7`
VARCHAR(20),`col_8` VARCHAR(20),`col_9` VARCHAR(20),
+ `col_10` VARCHAR(20),`col_11` VARCHAR(20),`col_12`
VARCHAR(20),`col_13` VARCHAR(20),`col_14` VARCHAR(20),
+ `col_15` VARCHAR(20),`col_16` VARCHAR(20),`col_17`
VARCHAR(20),`col_18` VARCHAR(20),`col_19` VARCHAR(20),
+ `col_20` VARCHAR(20),`col_21` VARCHAR(20),`col_22`
VARCHAR(20),`col_23` VARCHAR(20),`col_24` VARCHAR(20),
+ `col_25` VARCHAR(20),`col_26` VARCHAR(20),`col_27`
VARCHAR(20),`col_28` VARCHAR(20),`col_29` VARCHAR(20),
+ `col_30` VARCHAR(20),`col_31` VARCHAR(20),`col_32`
VARCHAR(20),`col_33` VARCHAR(20),`col_34` VARCHAR(20),
+ `col_35` VARCHAR(20),`col_36` VARCHAR(20),`col_37`
VARCHAR(20),`col_38` VARCHAR(20),`col_39` VARCHAR(20),
+ `col_40` VARCHAR(20),`col_41` VARCHAR(20),`col_42`
VARCHAR(20),`col_43` VARCHAR(20),`col_44` VARCHAR(20),
+ `col_45` VARCHAR(20),`col_46` VARCHAR(20),`col_47`
VARCHAR(20),`col_48` VARCHAR(20),`col_49` VARCHAR(20),
+ INDEX index_col_0 (`col_0`) USING INVERTED COMMENT '',
+ INDEX index_col_2 (`col_2`) USING INVERTED COMMENT ''
+ )
+ UNIQUE KEY(`col_0`) DISTRIBUTED BY HASH(`col_0`) BUCKETS 1
+ PROPERTIES (
+ "replication_num" = "1",
+ "enable_unique_key_merge_on_write" = "false"
+ );
+ """
+
+ def uuid = UUID.randomUUID().toString().replace("-", "0")
+ def path =
"oss://$bucket/regression/segcompaction_test/segcompaction_test.orc"
+
+ def columns = "col_0, col_1, col_2, col_3, col_4, col_5, col_6, col_7,
col_8, col_9, col_10, col_11, col_12, col_13, col_14, col_15, col_16, col_17,
col_18, col_19, col_20, col_21, col_22, col_23, col_24, col_25, col_26, col_27,
col_28, col_29, col_30, col_31, col_32, col_33, col_34, col_35, col_36, col_37,
col_38, col_39, col_40, col_41, col_42, col_43, col_44, col_45, col_46, col_47,
col_48, col_49"
+ String columns_str = ("$columns" != "") ? "($columns)" : "";
+
+ qt_select_default """ SELECT * FROM ${tableName} WHERE col_0=47 order
by col_1; """
+ qt_select_default """ SELECT COUNT(*) FROM ${tableName} WHERE col_1
MATCH_ANY 'lemon'; """
+ qt_select_default """ SELECT COUNT(*) FROM ${tableName} WHERE col_2
MATCH_ANY 'Lemon'; """
+
+ String[][] tablets = sql """ show tablets from ${tableName}; """
} finally {
try_sql("DROP TABLE IF EXISTS ${tableName}")
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]