This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-1.2-lts by this push:
new c2c86e56c7 [branch1.2] fix some regression test cases
c2c86e56c7 is described below
commit c2c86e56c7502732126adfae90823b0bb471e965
Author: morningman <[email protected]>
AuthorDate: Tue Jul 4 14:50:49 2023 +0800
[branch1.2] fix some regression test cases
---
.../data/performance_p0/redundant_conjuncts.out | 2 +
.../query_p0/join/test_collect_list_distinct.out | 4 +-
.../test_dynamic_partition_with_alter.groovy | 2 +-
.../test_dynamic_partition_with_rename.groovy | 60 ----------------------
.../suites/query_p0/cast/test_cast.groovy | 16 ------
.../join/test_collect_list_distinct.groovy | 9 ++--
.../test_uniq_mv_schema_change.groovy | 39 ++++++++++++--
7 files changed, 44 insertions(+), 88 deletions(-)
diff --git a/regression-test/data/performance_p0/redundant_conjuncts.out
b/regression-test/data/performance_p0/redundant_conjuncts.out
index 3baa5b3d93..dfaf44c5e0 100644
--- a/regression-test/data/performance_p0/redundant_conjuncts.out
+++ b/regression-test/data/performance_p0/redundant_conjuncts.out
@@ -12,6 +12,7 @@ PLAN FRAGMENT 0
PREDICATES: `k1` = 1
partitions=0/1, tablets=0/0, tabletList=
cardinality=0, avgRowSize=8.0, numNodes=1
+ limit: 9223372036854775807
-- !redundant_conjuncts_gnerated_by_extract_common_filter --
PLAN FRAGMENT 0
@@ -26,4 +27,5 @@ PLAN FRAGMENT 0
PREDICATES: `k1` = 1 OR `k1` = 2
partitions=0/1, tablets=0/0, tabletList=
cardinality=0, avgRowSize=8.0, numNodes=1
+ limit: 9223372036854775807
diff --git a/regression-test/data/query_p0/join/test_collect_list_distinct.out
b/regression-test/data/query_p0/join/test_collect_list_distinct.out
index 23cfae2049..b3b6622dce 100644
--- a/regression-test/data/query_p0/join/test_collect_list_distinct.out
+++ b/regression-test/data/query_p0/join/test_collect_list_distinct.out
@@ -11,6 +11,6 @@
1 7 12 car amory is cute
-- !select --
-12 ["amory clever"] car
-12 ["amory clever"] car
+12 ['amory clever'] car
+12 ['amory clever'] car
diff --git
a/regression-test/suites/partition_p0/dynamic_partition/test_dynamic_partition_with_alter.groovy
b/regression-test/suites/partition_p0/dynamic_partition/test_dynamic_partition_with_alter.groovy
index 32cfc742a7..671ce92fd3 100644
---
a/regression-test/suites/partition_p0/dynamic_partition/test_dynamic_partition_with_alter.groovy
+++
b/regression-test/suites/partition_p0/dynamic_partition/test_dynamic_partition_with_alter.groovy
@@ -34,7 +34,7 @@ suite("test_dynamic_partition_with_alter") {
"dynamic_partition.create_history_partition"="true",
"dynamic_partition.replication_allocation" =
"tag.location.default: 1")
"""
- result = sql "show partitions from ${tbl}"
+ def result = sql "show partitions from ${tbl}"
assertEquals(7, result.size())
// modify distributed column comment, then try to add too more dynamic
partition
diff --git
a/regression-test/suites/partition_p0/dynamic_partition/test_dynamic_partition_with_rename.groovy
b/regression-test/suites/partition_p0/dynamic_partition/test_dynamic_partition_with_rename.groovy
deleted file mode 100644
index b07a2f1a63..0000000000
---
a/regression-test/suites/partition_p0/dynamic_partition/test_dynamic_partition_with_rename.groovy
+++ /dev/null
@@ -1,60 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-suite("test_dynamic_partition_with_rename") {
- def tbl = "test_dynamic_partition_with_rename"
- sql "drop table if exists ${tbl}"
- sql """
- CREATE TABLE IF NOT EXISTS ${tbl}
- ( k1 date NOT NULL, k2 varchar(20) NOT NULL, k3 int sum NOT NULL )
- AGGREGATE KEY(k1,k2)
- PARTITION BY RANGE(k1) ( )
- DISTRIBUTED BY HASH(k1) BUCKETS 1
- PROPERTIES (
- "dynamic_partition.enable"="true",
- "dynamic_partition.end"="3",
- "dynamic_partition.buckets"="1",
- "dynamic_partition.start"="-3",
- "dynamic_partition.prefix"="p",
- "dynamic_partition.time_unit"="DAY",
- "dynamic_partition.create_history_partition"="true",
- "dynamic_partition.replication_allocation" =
"tag.location.default: 1")
- """
- result = sql "show partitions from ${tbl}"
- assertEquals(7, result.size())
-
- // rename distributed column, then try to add too more dynamic partition
- sql "alter table ${tbl} rename column k1 renamed_k1"
- sql """ ADMIN SET FRONTEND CONFIG
('dynamic_partition_check_interval_seconds' = '1') """
- sql """ alter table ${tbl} set('dynamic_partition.end'='5') """
- result = sql "show partitions from ${tbl}"
- for (def retry = 0; retry < 15; retry++) {
- if (result.size() == 9) {
- break;
- }
- logger.info("wait dynamic partition scheduler, sleep 1s")
- sleep(1000);
- result = sql "show partitions from ${tbl}"
- }
- assertEquals(9, result.size())
- for (def line = 0; line < result.size(); line++) {
- // XXX: DistributionKey at pos(7), next maybe impl by sql meta
- assertEquals("renamed_k1", result.get(line).get(7))
- }
-
- sql "drop table ${tbl}"
-}
diff --git a/regression-test/suites/query_p0/cast/test_cast.groovy
b/regression-test/suites/query_p0/cast/test_cast.groovy
index dcd04b076f..80a7c1bb4a 100644
--- a/regression-test/suites/query_p0/cast/test_cast.groovy
+++ b/regression-test/suites/query_p0/cast/test_cast.groovy
@@ -16,9 +16,6 @@
// under the License.
suite('test_cast') {
- def date = "date '2020-01-01'"
- def datev2 = "datev2 '2020-01-01'"
- def datetime = "timestamp '2020-01-01 12:34:45'"
def tbl = "test_cast"
sql """ DROP TABLE IF EXISTS ${tbl}"""
@@ -39,17 +36,4 @@ suite('test_cast') {
sql "select * from ${tbl} where case when k0 = 101 then 0 else 1 end"
result([])
}
-
- test {
- sql "select cast(${date} as int), cast(${date} as bigint),
cast(${date} as float), cast(${date} as double)"
- result([[20200101, 20200101l, ((float) 20200101), ((double)
20200101)]])
- }
- test {
- sql "select cast(${datev2} as int), cast(${datev2} as bigint),
cast(${datev2} as float), cast(${datev2} as double)"
- result([[20200101, 20200101l, ((float) 20200101), ((double)
20200101)]])
- }
- test {
- sql "select cast(${datetime} as int), cast(${datetime} as bigint),
cast(${datetime} as float), cast(${datetime} as double)"
- result([[869930357, 20200101123445l, ((float) 20200101123445l),
((double) 20200101123445l)]])
- }
}
diff --git
a/regression-test/suites/query_p0/join/test_collect_list_distinct.groovy
b/regression-test/suites/query_p0/join/test_collect_list_distinct.groovy
index 059e15180b..66193f2da0 100644
--- a/regression-test/suites/query_p0/join/test_collect_list_distinct.groovy
+++ b/regression-test/suites/query_p0/join/test_collect_list_distinct.groovy
@@ -38,8 +38,7 @@ suite("test_collect_list_distinct") {
"replication_allocation" = "tag.location.default: 1",
"storage_format" = "V2",
"light_schema_change" = "true",
- "disable_auto_compaction" = "false",
- "enable_single_replica_compaction" = "false"
+ "disable_auto_compaction" = "false"
);
"""
sql """
@@ -57,8 +56,7 @@ suite("test_collect_list_distinct") {
"replication_allocation" = "tag.location.default: 1",
"storage_format" = "V2",
"light_schema_change" = "true",
- "disable_auto_compaction" = "false",
- "enable_single_replica_compaction" = "false"
+ "disable_auto_compaction" = "false"
);
"""
sql """
@@ -74,8 +72,7 @@ suite("test_collect_list_distinct") {
"replication_allocation" = "tag.location.default: 1",
"storage_format" = "V2",
"light_schema_change" = "true",
- "disable_auto_compaction" = "false",
- "enable_single_replica_compaction" = "false"
+ "disable_auto_compaction" = "false"
);
"""
diff --git
a/regression-test/suites/schema_change_p0/test_uniq_mv_schema_change.groovy
b/regression-test/suites/schema_change_p0/test_uniq_mv_schema_change.groovy
index e2c2a20893..35a031e7ca 100644
--- a/regression-test/suites/schema_change_p0/test_uniq_mv_schema_change.groovy
+++ b/regression-test/suites/schema_change_p0/test_uniq_mv_schema_change.groovy
@@ -20,6 +20,11 @@ import org.codehaus.groovy.runtime.IOGroovyMethods
suite ("test_uniq_mv_schema_change") {
def tableName = "schema_change_uniq_mv_regression_test"
+ def getJobColumnState = { tName ->
+ def jobStateResult = sql """ SHOW ALTER TABLE COLUMN WHERE
TableName='${tName}' ORDER BY CreateTime DESC LIMIT 1; """
+ return jobStateResult[0][9]
+ }
+
try {
String[][] backends = sql """ show backends; """
assertTrue(backends.size() > 0)
@@ -55,7 +60,7 @@ suite ("test_uniq_mv_schema_change") {
disableAutoCompaction = Boolean.parseBoolean(((List<String>)
ele)[2])
}
}
- sql """ DROP TABLE IF EXISTS ${tableName} """
+ sql """ DROP TABLE IF EXISTS ${tableName} force"""
sql """
CREATE TABLE IF NOT EXISTS ${tableName} (
@@ -86,7 +91,7 @@ suite ("test_uniq_mv_schema_change") {
if(result.contains("CANCELLED")){
return
}
- Thread.sleep(100)
+ Thread.sleep(1000)
}
sql """ INSERT INTO ${tableName} VALUES
@@ -110,9 +115,23 @@ suite ("test_uniq_mv_schema_change") {
// add column
sql """
- ALTER table ${tableName} ADD COLUMN new_column INT default "1"
+ ALTER TABLE ${tableName} ADD COLUMN new_column INT default "1"
"""
+ def max_try_secs = 60
+ while (max_try_secs--) {
+ String res = getJobColumnState(tableName)
+ if (res == "FINISHED") {
+ break
+ } else {
+ Thread.sleep(2000)
+ if (max_try_secs < 1) {
+ println "test timeout," + "state:" + res
+ assertEquals("FINISHED", res)
+ }
+ }
+ }
+
sql """ SELECT * FROM ${tableName} WHERE user_id=2 """
sql """ INSERT INTO ${tableName}
(`user_id`,`date`,`city`,`age`,`sex`,`last_visit_date`,`last_update_date`,
@@ -137,6 +156,20 @@ suite ("test_uniq_mv_schema_change") {
ALTER TABLE ${tableName} DROP COLUMN cost
"""
+ max_try_secs = 60
+ while (max_try_secs--) {
+ String res = getJobColumnState(tableName)
+ if (res == "FINISHED") {
+ break
+ } else {
+ Thread.sleep(2000)
+ if (max_try_secs < 1) {
+ println "test timeout," + "state:" + res
+ assertEquals("FINISHED", res)
+ }
+ }
+ }
+
qt_sc """ select * from ${tableName} where user_id = 3 """
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]