This is an automated email from the ASF dual-hosted git repository. yiguolei 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 4719d4705f [regression] update test framework and fix cases (#10686) 4719d4705f is described below commit 4719d4705fd1edf0df93a70504f378fad9d27bbb Author: Dongyang Li <hello_step...@qq.com> AuthorDate: Wed Jul 13 10:16:16 2022 +0800 [regression] update test framework and fix cases (#10686) and regression test exclude suite test_create_table_with_bloom_filter temporarily. Co-authored-by: stephen <hello-step...@qq.com> --- regression-test/conf/regression-conf.groovy | 2 +- regression-test/data/index/test_bitmap_index.out | 68 ++++++++++---------- .../data/performance/redundant_conjuncts.out | 4 +- .../org/apache/doris/regression/Config.groovy | 35 +++++++---- .../regression/action/StreamLoadAction.groovy | 6 +- .../doris/regression/suite/SuiteContext.groovy | 7 ++- .../doris/regression/suite/SuiteScript.groovy | 11 +++- regression-test/suites/index/test_index.groovy | 7 +++ .../suites/query/aggregate/aggregate.groovy | 2 +- .../test_aggregate_all_functions.groovy | 72 +++++++++++----------- .../conditional_functions/test_nullif.groovy | 2 +- .../sql_block_rule/test_sql_block_rule.groovy | 20 +++++- 12 files changed, 145 insertions(+), 91 deletions(-) diff --git a/regression-test/conf/regression-conf.groovy b/regression-test/conf/regression-conf.groovy index 928167d346..b7683cc679 100644 --- a/regression-test/conf/regression-conf.groovy +++ b/regression-test/conf/regression-conf.groovy @@ -46,7 +46,7 @@ testDirectories = "" // this groups will not be executed excludeGroups = "" // this suites will not be executed -excludeSuites = "" +excludeSuites = "test_create_table_with_bloom_filter" // this directories will not be executed excludeDirectories = "" diff --git a/regression-test/data/index/test_bitmap_index.out b/regression-test/data/index/test_bitmap_index.out index f9962c5bfc..5f2b6cb0e8 100644 --- a/regression-test/data/index/test_bitmap_index.out +++ b/regression-test/data/index/test_bitmap_index.out @@ -13,17 +13,17 @@ k10 DECIMAL(9,0) Yes false \N NONE k11 BOOLEAN Yes false \N NONE -- !sql -- -default_cluster:regression_test.test_bitmap_index_dup index1 k1 BITMAP -default_cluster:regression_test.test_bitmap_index_dup index2 k2 BITMAP -default_cluster:regression_test.test_bitmap_index_dup index3 k3 BITMAP -default_cluster:regression_test.test_bitmap_index_dup index4 k4 BITMAP -default_cluster:regression_test.test_bitmap_index_dup index5 k5 BITMAP -default_cluster:regression_test.test_bitmap_index_dup index6 k6 BITMAP -default_cluster:regression_test.test_bitmap_index_dup index7 k7 BITMAP -default_cluster:regression_test.test_bitmap_index_dup index8 k8 BITMAP -default_cluster:regression_test.test_bitmap_index_dup index9 k9 BITMAP -default_cluster:regression_test.test_bitmap_index_dup index10 k10 BITMAP -default_cluster:regression_test.test_bitmap_index_dup index11 k11 BITMAP +default_cluster:regression_test_index.test_bitmap_index_dup index1 k1 BITMAP +default_cluster:regression_test_index.test_bitmap_index_dup index2 k2 BITMAP +default_cluster:regression_test_index.test_bitmap_index_dup index3 k3 BITMAP +default_cluster:regression_test_index.test_bitmap_index_dup index4 k4 BITMAP +default_cluster:regression_test_index.test_bitmap_index_dup index5 k5 BITMAP +default_cluster:regression_test_index.test_bitmap_index_dup index6 k6 BITMAP +default_cluster:regression_test_index.test_bitmap_index_dup index7 k7 BITMAP +default_cluster:regression_test_index.test_bitmap_index_dup index8 k8 BITMAP +default_cluster:regression_test_index.test_bitmap_index_dup index9 k9 BITMAP +default_cluster:regression_test_index.test_bitmap_index_dup index10 k10 BITMAP +default_cluster:regression_test_index.test_bitmap_index_dup index11 k11 BITMAP -- !sql -- 1 1 1 1 1 1 2022-05-31 2022-05-31T10:00 1 1 true @@ -43,17 +43,17 @@ k11 BOOLEAN Yes true \N v1 INT Yes false \N SUM -- !sql -- -default_cluster:regression_test.test_bitmap_index_agg index1 k1 BITMAP -default_cluster:regression_test.test_bitmap_index_agg index2 k2 BITMAP -default_cluster:regression_test.test_bitmap_index_agg index3 k3 BITMAP -default_cluster:regression_test.test_bitmap_index_agg index4 k4 BITMAP -default_cluster:regression_test.test_bitmap_index_agg index5 k5 BITMAP -default_cluster:regression_test.test_bitmap_index_agg index6 k6 BITMAP -default_cluster:regression_test.test_bitmap_index_agg index7 k7 BITMAP -default_cluster:regression_test.test_bitmap_index_agg index8 k8 BITMAP -default_cluster:regression_test.test_bitmap_index_agg index9 k9 BITMAP -default_cluster:regression_test.test_bitmap_index_agg index10 k10 BITMAP -default_cluster:regression_test.test_bitmap_index_agg index11 k11 BITMAP +default_cluster:regression_test_index.test_bitmap_index_agg index1 k1 BITMAP +default_cluster:regression_test_index.test_bitmap_index_agg index2 k2 BITMAP +default_cluster:regression_test_index.test_bitmap_index_agg index3 k3 BITMAP +default_cluster:regression_test_index.test_bitmap_index_agg index4 k4 BITMAP +default_cluster:regression_test_index.test_bitmap_index_agg index5 k5 BITMAP +default_cluster:regression_test_index.test_bitmap_index_agg index6 k6 BITMAP +default_cluster:regression_test_index.test_bitmap_index_agg index7 k7 BITMAP +default_cluster:regression_test_index.test_bitmap_index_agg index8 k8 BITMAP +default_cluster:regression_test_index.test_bitmap_index_agg index9 k9 BITMAP +default_cluster:regression_test_index.test_bitmap_index_agg index10 k10 BITMAP +default_cluster:regression_test_index.test_bitmap_index_agg index11 k11 BITMAP -- !sql -- 1 1 1 1 1 1 2022-05-31 2022-05-31T10:00 1 1 true 1 @@ -73,18 +73,18 @@ k11 BOOLEAN Yes true \N v1 INT Yes false \N REPLACE -- !sql -- -default_cluster:regression_test.test_bitmap_index_unique index1 k1 BITMAP -default_cluster:regression_test.test_bitmap_index_unique index2 k2 BITMAP -default_cluster:regression_test.test_bitmap_index_unique index3 k3 BITMAP -default_cluster:regression_test.test_bitmap_index_unique index4 k4 BITMAP -default_cluster:regression_test.test_bitmap_index_unique index5 k5 BITMAP -default_cluster:regression_test.test_bitmap_index_unique index6 k6 BITMAP -default_cluster:regression_test.test_bitmap_index_unique index7 k7 BITMAP -default_cluster:regression_test.test_bitmap_index_unique index8 k8 BITMAP -default_cluster:regression_test.test_bitmap_index_unique index9 k9 BITMAP -default_cluster:regression_test.test_bitmap_index_unique index10 k10 BITMAP -default_cluster:regression_test.test_bitmap_index_unique index11 k11 BITMAP -default_cluster:regression_test.test_bitmap_index_unique index12 v1 BITMAP +default_cluster:regression_test_index.test_bitmap_index_unique index1 k1 BITMAP +default_cluster:regression_test_index.test_bitmap_index_unique index2 k2 BITMAP +default_cluster:regression_test_index.test_bitmap_index_unique index3 k3 BITMAP +default_cluster:regression_test_index.test_bitmap_index_unique index4 k4 BITMAP +default_cluster:regression_test_index.test_bitmap_index_unique index5 k5 BITMAP +default_cluster:regression_test_index.test_bitmap_index_unique index6 k6 BITMAP +default_cluster:regression_test_index.test_bitmap_index_unique index7 k7 BITMAP +default_cluster:regression_test_index.test_bitmap_index_unique index8 k8 BITMAP +default_cluster:regression_test_index.test_bitmap_index_unique index9 k9 BITMAP +default_cluster:regression_test_index.test_bitmap_index_unique index10 k10 BITMAP +default_cluster:regression_test_index.test_bitmap_index_unique index11 k11 BITMAP +default_cluster:regression_test_index.test_bitmap_index_unique index12 v1 BITMAP -- !sql -- 1 1 1 1 1 1 2022-05-31 2022-05-31T10:00 1 1 true 1 diff --git a/regression-test/data/performance/redundant_conjuncts.out b/regression-test/data/performance/redundant_conjuncts.out index ee24a20e85..38a21a6e3d 100644 --- a/regression-test/data/performance/redundant_conjuncts.out +++ b/regression-test/data/performance/redundant_conjuncts.out @@ -3,7 +3,7 @@ PLAN FRAGMENT 0 OUTPUT EXPRS: `v1` - PARTITION: HASH_PARTITIONED: `default_cluster:regression_test`.`redundant_conjuncts`.`k1` + PARTITION: HASH_PARTITIONED: `default_cluster:regression_test_performance`.`redundant_conjuncts`.`k1` VRESULT SINK @@ -17,7 +17,7 @@ PLAN FRAGMENT 0 PLAN FRAGMENT 0 OUTPUT EXPRS: `v1` - PARTITION: HASH_PARTITIONED: `default_cluster:regression_test`.`redundant_conjuncts`.`k1` + PARTITION: HASH_PARTITIONED: `default_cluster:regression_test_performance`.`redundant_conjuncts`.`k1` VRESULT SINK diff --git a/regression-test/framework/src/main/groovy/org/apache/doris/regression/Config.groovy b/regression-test/framework/src/main/groovy/org/apache/doris/regression/Config.groovy index 818aead43e..3e85d7a923 100644 --- a/regression-test/framework/src/main/groovy/org/apache/doris/regression/Config.groovy +++ b/regression-test/framework/src/main/groovy/org/apache/doris/regression/Config.groovy @@ -335,9 +335,13 @@ class Config { } void tryCreateDbIfNotExist() { + tryCreateDbIfNotExist(defaultDb) + } + + void tryCreateDbIfNotExist(String dbName) { // connect without specify default db try { - String sql = "CREATE DATABASE IF NOT EXISTS ${defaultDb}" + String sql = "CREATE DATABASE IF NOT EXISTS ${dbName}" log.info("Try to create db, sql: ${sql}".toString()) getConnection().withCloseable { conn -> JdbcUtils.executeToList(conn, sql) @@ -351,6 +355,13 @@ class Config { return DriverManager.getConnection(jdbcUrl, jdbcUser, jdbcPassword) } + Connection getConnection(String group) { + String dbUrl = buildUrl(defaultDb + '_' + group) + tryCreateDbIfNotExist(defaultDb + '_' + group) + log.info("connect to ${dbUrl}".toString()) + return DriverManager.getConnection(dbUrl, jdbcUser, jdbcPassword) + } + Predicate<String> getDirectoryFilter() { return (Predicate<String>) { String directoryName -> if (directories.isEmpty() && excludeDirectorySet.isEmpty()) { @@ -377,25 +388,27 @@ class Config { } private void buildUrlWithDefaultDb() { + this.jdbcUrl = buildUrl(defaultDb) + log.info("Reset jdbcUrl to ${jdbcUrl}".toString()) + } + + private String buildUrl(String dbName) { String urlWithDb = jdbcUrl String urlWithoutSchema = jdbcUrl.substring(jdbcUrl.indexOf("://") + 3) if (urlWithoutSchema.indexOf("/") >= 0) { if (jdbcUrl.contains("?")) { - // e.g: jdbc:mysql://localhost:8080/?a=b + // e.g: jdbc:mysql://locahost:8080/?a=b urlWithDb = jdbcUrl.substring(0, jdbcUrl.lastIndexOf("/")) - urlWithDb += ("/" + defaultDb) + jdbcUrl.substring(jdbcUrl.lastIndexOf("?")) + urlWithDb += ("/" + dbName) + jdbcUrl.substring(jdbcUrl.lastIndexOf("?")) } else { - // e.g: jdbc:mysql://localhost:8080/ - urlWithDb += defaultDb + // e.g: jdbc:mysql://locahost:8080/ + urlWithDb += dbName } } else { - // e.g: jdbc:mysql://localhost:8080 - urlWithDb += ("/" + defaultDb) + // e.g: jdbc:mysql://locahost:8080 + urlWithDb += ("/" + dbName) } - this.jdbcUrl = urlWithDb - log.info("Reset jdbcUrl to ${jdbcUrl}".toString()) - // check connection with default db - getConnection().close() + return urlWithDb } } diff --git a/regression-test/framework/src/main/groovy/org/apache/doris/regression/action/StreamLoadAction.groovy b/regression-test/framework/src/main/groovy/org/apache/doris/regression/action/StreamLoadAction.groovy index c9bc4cb090..4aee6e4fb7 100644 --- a/regression-test/framework/src/main/groovy/org/apache/doris/regression/action/StreamLoadAction.groovy +++ b/regression-test/framework/src/main/groovy/org/apache/doris/regression/action/StreamLoadAction.groovy @@ -57,7 +57,11 @@ class StreamLoadAction implements SuiteAction { this.address = context.config.feHttpInetSocketAddress this.user = context.config.feHttpUser this.password = context.config.feHttpPassword - this.db = context.config.defaultDb + + def groupList = context.group.split(',') + def topGroup = groupList[groupList.length - 1].replace(File.separator, '_') + this.db = context.config.defaultDb + "_" + topGroup + this.context = context this.headers = new LinkedHashMap<>() this.headers.put('label', UUID.randomUUID().toString()) diff --git a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/SuiteContext.groovy b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/SuiteContext.groovy index 9a5e0c326d..b03e2052cc 100644 --- a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/SuiteContext.groovy +++ b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/SuiteContext.groovy @@ -73,10 +73,13 @@ class SuiteContext implements Closeable { this.outputFile = new File(new File(config.dataPath), outputRelativePath) this.realOutputFile = new File(new File(config.realDataPath), realOutputRelativePath) this.dataPath = this.outputFile.getParentFile().getCanonicalFile() + // - flowName: tpcds_sf1.sql.q47.q47, flowId: tpcds_sf1/sql/q47.sql#q47 + log.info("flowName: ${flowName}, flowId: ${flowId}".toString()) } String getPackageName() { String packageName = scriptContext.name + log.info("packageName: ${packageName}".toString()) int dirSplitPos = packageName.lastIndexOf(File.separator) if (dirSplitPos != -1) { packageName = packageName.substring(0, dirSplitPos) @@ -87,6 +90,7 @@ class SuiteContext implements Closeable { String getClassName() { String scriptFileName = scriptContext.file.name + log.info("scriptFileName: ${scriptFileName}".toString()) int suffixPos = scriptFileName.lastIndexOf(".") String className = scriptFileName if (suffixPos != -1) { @@ -103,7 +107,8 @@ class SuiteContext implements Closeable { Connection getConnection() { def threadConn = threadLocalConn.get() if (threadConn == null) { - threadConn = config.getConnection() + def groupList = group.split(',') + threadConn = config.getConnection(groupList[groupList.length - 1].replace(File.separator, '_')) threadLocalConn.set(threadConn) } return threadConn diff --git a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/SuiteScript.groovy b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/SuiteScript.groovy index 7122b37fc1..fd593077c2 100644 --- a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/SuiteScript.groovy +++ b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/SuiteScript.groovy @@ -20,7 +20,9 @@ package org.apache.doris.regression.suite import groovy.transform.CompileStatic import org.slf4j.Logger import org.slf4j.LoggerFactory +import groovy.util.logging.Slf4j +@Slf4j @CompileStatic abstract class SuiteScript extends Script { public ScriptContext context @@ -38,17 +40,22 @@ abstract class SuiteScript extends Script { try { context.createAndRunSuite(suiteName, group, suiteBody) } catch (Throwable t) { - logger.warn("Unexcept exception when run ${suiteName} in ${context.file.absolutePath} failed", t) + log.warn("Unexcept exception when run ${suiteName} in ${context.file.absolutePath} failed", t) } } static String getDefaultGroups(File suiteRoot, File scriptFile) { String path = suiteRoot.relativePath(scriptFile.parentFile) + String groupPath = path; + if (path.indexOf(File.separator + "sql") > 0) { + groupPath = path.substring(0, path.indexOf(File.separator + "sql")) + } + log.info("path: ${path}, groupPath: ${groupPath}".toString()) List<String> groups = ["default"] String parentGroup = "" - path.split(File.separator) + groupPath.split(File.separator) .collect {it.trim()} .findAll {it != "." && it != ".." && !it.isEmpty()} .each { diff --git a/regression-test/suites/index/test_index.groovy b/regression-test/suites/index/test_index.groovy index 7f43480f6f..c0cff49926 100644 --- a/regression-test/suites/index/test_index.groovy +++ b/regression-test/suites/index/test_index.groovy @@ -16,6 +16,13 @@ // under the License. suite("test_index", "index") { // todo: test bitmap index, such as create, drop, alter table index + sql "DROP TABLE IF EXISTS t1" + sql """ + CREATE TABLE IF NOT EXISTS t1 ( + col1 int not null, + col2 char(10) + )DISTRIBUTED BY HASH(col1) BUCKETS 5 properties("replication_num" = "1"); + """ def tables = sql "show tables" def tb = tables[0][0] logger.info("$tb") diff --git a/regression-test/suites/query/aggregate/aggregate.groovy b/regression-test/suites/query/aggregate/aggregate.groovy index 0fa1d52518..edd7a9b8e1 100644 --- a/regression-test/suites/query/aggregate/aggregate.groovy +++ b/regression-test/suites/query/aggregate/aggregate.groovy @@ -19,7 +19,7 @@ // /testing/trino-product-tests/src/main/resources/sql-tests/testcases/aggregate // and modified by Doris. -suite("aggregate") { +suite("aggregate", "query") { def tableName = "datetype" sql """ DROP TABLE IF EXISTS ${tableName} """ diff --git a/regression-test/suites/query/sql_functions/aggregate_functions/test_aggregate_all_functions.groovy b/regression-test/suites/query/sql_functions/aggregate_functions/test_aggregate_all_functions.groovy index 811467ce62..6a3cc7ba47 100644 --- a/regression-test/suites/query/sql_functions/aggregate_functions/test_aggregate_all_functions.groovy +++ b/regression-test/suites/query/sql_functions/aggregate_functions/test_aggregate_all_functions.groovy @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -suite("sql_action", "query") { +suite("test_aggregate_all_functions", "query") { sql "set enable_vectorized_engine = true" sql "set batch_size = 4096" @@ -34,7 +34,7 @@ suite("sql_action", "query") { ) """ sql "INSERT INTO ${tableName_01} values(1,'beijing'), (2,'xian'), (3,'xian')" - qt_select1 "select approx_count_distinct(id) from ${context.config.defaultDb}.${tableName_01} group by group_type" + qt_select1 "select approx_count_distinct(id) from ${tableName_01} group by group_type" sql "DROP TABLE IF EXISTS ${tableName_01}" @@ -53,8 +53,8 @@ suite("sql_action", "query") { ) """ sql "INSERT INTO ${tableName_02} values(1,100,'beijing'), (2,70,'xian'), (3,90,'xian') ,(4,100,'beijing') ,(5,140,'xian') ,(6,100,'beijing')" - qt_select2 "select group_type,AVG(level) from ${context.config.defaultDb}.${tableName_02} group by group_type order by group_type" - qt_select3 "select group_type,AVG(distinct level) from ${context.config.defaultDb}.${tableName_02} group by group_type order by group_type" + qt_select2 "select group_type,AVG(level) from ${tableName_02} group by group_type order by group_type" + qt_select3 "select group_type,AVG(distinct level) from ${tableName_02} group by group_type order by group_type" sql "DROP TABLE IF EXISTS ${tableName_02}" @@ -126,9 +126,9 @@ suite("sql_action", "query") { ) """ sql "INSERT INTO ${tableName_05} values(1,'beijing'), (2,'xian'), (2,'xian') ,(4,'beijing') ,(5,'xian') ,(6,'beijing')" - qt_select6 "select group_type,count(*) from ${context.config.defaultDb}.${tableName_05} group by group_type order by group_type" - qt_select7 "select group_type,count(id) from ${context.config.defaultDb}.${tableName_05} group by group_type order by group_type" - qt_select8 "select group_type,count(distinct id) from ${context.config.defaultDb}.${tableName_05} group by group_type order by group_type" + qt_select6 "select group_type,count(*) from ${tableName_05} group by group_type order by group_type" + qt_select7 "select group_type,count(id) from ${tableName_05} group by group_type order by group_type" + qt_select8 "select group_type,count(distinct id) from ${tableName_05} group by group_type order by group_type" sql "DROP TABLE IF EXISTS ${tableName_05}" @@ -188,7 +188,7 @@ suite("sql_action", "query") { """ sql "INSERT INTO ${tableName_08} select id,hll_hash(group_type) from ${tableName_07}" - qt_select15 "select id,HLL_UNION_AGG(group_type) from ${context.config.defaultDb}.${tableName_08} group by id order by id" + qt_select15 "select id,HLL_UNION_AGG(group_type) from ${tableName_08} group by id order by id" sql "DROP TABLE IF EXISTS ${tableName_07}" sql "DROP TABLE IF EXISTS ${tableName_08}" @@ -210,8 +210,8 @@ suite("sql_action", "query") { """ sql "INSERT INTO ${tableName_09} values(1,10), (2,8), (2,441) ,(3,10) ,(5,29) ,(6,101)" - qt_select16 "select id,MAX(level) from ${context.config.defaultDb}.${tableName_09} group by id order by id" - qt_select17 "select MAX(level) from ${context.config.defaultDb}.${tableName_09}" + qt_select16 "select id,MAX(level) from ${tableName_09} group by id order by id" + qt_select17 "select MAX(level) from ${tableName_09}" sql "DROP TABLE IF EXISTS ${tableName_09}" @@ -231,8 +231,8 @@ suite("sql_action", "query") { """ sql "INSERT INTO ${tableName_11} values(1,10), (2,8), (2,441) ,(3,10) ,(5,29) ,(6,101)" - qt_select18 "select id,MIN(level) from ${context.config.defaultDb}.${tableName_11} group by id order by id" - qt_select19 "select MIN(level) from ${context.config.defaultDb}.${tableName_11}" + qt_select18 "select id,MIN(level) from ${tableName_11} group by id order by id" + qt_select19 "select MIN(level) from ${tableName_11}" sql "DROP TABLE IF EXISTS ${tableName_11}" @@ -253,9 +253,9 @@ suite("sql_action", "query") { """ sql "INSERT INTO ${tableName_13} values(1,10), (2,8), (2,441) ,(3,10) ,(5,29) ,(6,101)" - qt_select20 "select id,percentile(level,0.5) from ${context.config.defaultDb}.${tableName_13} group by id order by id" - qt_select21 "select id,percentile(level,0.55) from ${context.config.defaultDb}.${tableName_13} group by id order by id" - qt_select22 "select id,percentile(level,0.805) from ${context.config.defaultDb}.${tableName_13} group by id order by id" + qt_select20 "select id,percentile(level,0.5) from ${tableName_13} group by id order by id" + qt_select21 "select id,percentile(level,0.55) from ${tableName_13} group by id order by id" + qt_select22 "select id,percentile(level,0.805) from ${tableName_13} group by id order by id" sql "DROP TABLE IF EXISTS ${tableName_13}" @@ -277,12 +277,12 @@ suite("sql_action", "query") { sql "INSERT INTO ${tableName_14} values(1,10), (2,8), (2,441) ,(3,10) ,(5,29) ,(6,101)" - qt_select23 "select id,PERCENTILE_APPROX(level,0.5) from ${context.config.defaultDb}.${tableName_14} group by id order by id" - qt_select24 "select id,PERCENTILE_APPROX(level,0.55) from ${context.config.defaultDb}.${tableName_14} group by id order by id" - qt_select25 "select id,PERCENTILE_APPROX(level,0.805) from ${context.config.defaultDb}.${tableName_14} group by id order by id" - qt_select26 "select id,PERCENTILE_APPROX(level,0.5,2048) from ${context.config.defaultDb}.${tableName_14} group by id order by id" - qt_select27 "select id,PERCENTILE_APPROX(level,0.55,2048) from ${context.config.defaultDb}.${tableName_14} group by id order by id" - qt_select28 "select id,PERCENTILE_APPROX(level,0.805,2048) from ${context.config.defaultDb}.${tableName_14} group by id order by id" + qt_select23 "select id,PERCENTILE_APPROX(level,0.5) from ${tableName_14} group by id order by id" + qt_select24 "select id,PERCENTILE_APPROX(level,0.55) from ${tableName_14} group by id order by id" + qt_select25 "select id,PERCENTILE_APPROX(level,0.805) from ${tableName_14} group by id order by id" + qt_select26 "select id,PERCENTILE_APPROX(level,0.5,2048) from ${tableName_14} group by id order by id" + qt_select27 "select id,PERCENTILE_APPROX(level,0.55,2048) from ${tableName_14} group by id order by id" + qt_select28 "select id,PERCENTILE_APPROX(level,0.805,2048) from ${tableName_14} group by id order by id" sql "DROP TABLE IF EXISTS ${tableName_14}" @@ -304,8 +304,8 @@ suite("sql_action", "query") { sql "INSERT INTO ${tableName_15} values(1,10), (2,8), (2,441) ,(1,10) ,(3,29) ,(3,101)" - qt_select29 "select id,stddev(level) from ${context.config.defaultDb}.${tableName_15} group by id order by id" - qt_select30 "select id,stddev_pop(level) from ${context.config.defaultDb}.${tableName_15} group by id order by id" + qt_select29 "select id,stddev(level) from ${tableName_15} group by id order by id" + qt_select30 "select id,stddev_pop(level) from ${tableName_15} group by id order by id" sql "DROP TABLE IF EXISTS ${tableName_15}" @@ -326,7 +326,7 @@ suite("sql_action", "query") { """ sql "INSERT INTO ${tableName_16} values(1,10), (2,8), (2,441) ,(1,10) ,(3,29) ,(3,101)" - qt_select31 "select id,stddev_samp(level) from ${context.config.defaultDb}.${tableName_16} group by id order by id" + qt_select31 "select id,stddev_samp(level) from ${tableName_16} group by id order by id" sql "DROP TABLE IF EXISTS ${tableName_16}" @@ -347,8 +347,8 @@ suite("sql_action", "query") { """ sql "INSERT INTO ${tableName_17} values(1,10), (2,8), (2,441) ,(1,10) ,(3,29) ,(3,101)" - qt_select32 "select id,sum(level) from ${context.config.defaultDb}.${tableName_17} group by id order by id" - qt_select33 "select sum(level) from ${context.config.defaultDb}.${tableName_17}" + qt_select32 "select id,sum(level) from ${tableName_17} group by id order by id" + qt_select33 "select sum(level) from ${tableName_17}" sql "DROP TABLE IF EXISTS ${tableName_17}" @@ -369,9 +369,9 @@ suite("sql_action", "query") { """ sql "INSERT INTO ${tableName_18} values(1,10), (2,18), (2,441) ,(1,10) ,(3,29) ,(3,101),(1,11), (2,18), (2,41) ,(1,13) ,(3,4) ,(3,12)" - qt_select34 "select id,topn(level,2) from ${context.config.defaultDb}.${tableName_18} group by id order by id" - qt_select35 "select id,topn(level,2,100) from ${context.config.defaultDb}.${tableName_18} group by id order by id" - qt_select36 "select topn(level,2,100) from ${context.config.defaultDb}.${tableName_18}" + qt_select34 "select id,topn(level,2) from ${tableName_18} group by id order by id" + qt_select35 "select id,topn(level,2,100) from ${tableName_18} group by id order by id" + qt_select36 "select topn(level,2,100) from ${tableName_18}" sql "DROP TABLE IF EXISTS ${tableName_18}" @@ -392,8 +392,8 @@ suite("sql_action", "query") { """ sql "INSERT INTO ${tableName_19} values(1,10), (2,8), (2,441) ,(1,10) ,(3,29) ,(3,101)" - qt_select37 = sql "select id,var_samp(level) from ${context.config.defaultDb}.${tableName_19} group by id order by id" - qt_select38 = sql "select id,variance_samp(level) from ${context.config.defaultDb}.${tableName_19} group by id order by id" + qt_select37 = sql "select id,var_samp(level) from ${tableName_19} group by id order by id" + qt_select38 = sql "select id,variance_samp(level) from ${tableName_19} group by id order by id" sql "DROP TABLE IF EXISTS ${tableName_19}" @@ -414,9 +414,9 @@ suite("sql_action", "query") { """ sql "INSERT INTO ${tableName_20} values(1,10), (2,8), (2,441) ,(1,10) ,(3,29) ,(3,101)" - qt_select39 "select id,VARIANCE(level) from ${context.config.defaultDb}.${tableName_20} group by id order by id" - qt_select40 "select id,VAR_POP(level) from ${context.config.defaultDb}.${tableName_20} group by id order by id" - qt_select41 "select id,VARIANCE_POP(level) from ${context.config.defaultDb}.${tableName_20} group by id order by id" + qt_select39 "select id,VARIANCE(level) from ${tableName_20} group by id order by id" + qt_select40 "select id,VAR_POP(level) from ${tableName_20} group by id order by id" + qt_select41 "select id,VARIANCE_POP(level) from ${tableName_20} group by id order by id" sql "DROP TABLE IF EXISTS ${tableName_20}" @@ -437,7 +437,7 @@ suite("sql_action", "query") { """ sql "INSERT INTO ${tableName_10} values(1,10), (2,8), (2,441) ,(3,10) ,(5,29) ,(6,101)" - qt_select42 "select MAX_BY(id,level) from ${context.config.defaultDb}.${tableName_10}" + qt_select42 "select MAX_BY(id,level) from ${tableName_10}" sql "DROP TABLE IF EXISTS ${tableName_10}" @@ -457,7 +457,7 @@ suite("sql_action", "query") { """ sql "INSERT INTO ${tableName_12} values(1,10), (2,8), (2,441) ,(3,10) ,(5,29) ,(6,101)" - qt_select43 "select MIN_BY(id,level) from ${context.config.defaultDb}.${tableName_12}" + qt_select43 "select MIN_BY(id,level) from ${tableName_12}" sql "DROP TABLE IF EXISTS ${tableName_10}" } diff --git a/regression-test/suites/query/sql_functions/conditional_functions/test_nullif.groovy b/regression-test/suites/query/sql_functions/conditional_functions/test_nullif.groovy index 8f4ddea008..368f194552 100644 --- a/regression-test/suites/query/sql_functions/conditional_functions/test_nullif.groovy +++ b/regression-test/suites/query/sql_functions/conditional_functions/test_nullif.groovy @@ -17,5 +17,5 @@ suite("test_nullif", "query") { qt_select "select nullif(k6, \"false\") k from test_query_db.test order by k1" - qt_select "select if(c_date is null,c_timestamp,c_date) from ${context.config.defaultDb}.datetype where c_date is null and c_timestamp is not null" + qt_select "select if(c_date is null,c_timestamp,c_date) from datetype where c_date is null and c_timestamp is not null" } diff --git a/regression-test/suites/sql_block_rule/test_sql_block_rule.groovy b/regression-test/suites/sql_block_rule/test_sql_block_rule.groovy index 1849feb6b4..fd059dadfd 100644 --- a/regression-test/suites/sql_block_rule/test_sql_block_rule.groovy +++ b/regression-test/suites/sql_block_rule/test_sql_block_rule.groovy @@ -17,8 +17,26 @@ suite("test_sql_block_rule", "sql_block_rule") { sql """ - USE ${context.config.defaultDb} + DROP SQL_BLOCK_RULE if exists test_rule_num + """ + sql """ + DROP SQL_BLOCK_RULE if exists test_rule_sql """ + sql """ + CREATE TABLE IF NOT EXISTS `table_2` ( + `abcd` varchar(150) NULL COMMENT "", + `create_time` datetime NULL COMMENT "" + ) ENGINE=OLAP + UNIQUE KEY(`abcd`) + COMMENT "OLAP" + DISTRIBUTED BY HASH(`abcd`) BUCKETS 3 + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "in_memory" = "false", + "storage_format" = "V2" + ) + """ + sql """ INSERT INTO table_2 VALUES ('H220427011909850160918','2022-04-27 16:00:33'),('T220427400109910160949','2022-04-27 16:00:54'),('T220427400123770120058','2022-04-27 16:00:56'),('T220427400126530112854','2022-04-27 16:00:34'),('T220427400127160144672','2022-04-27 16:00:10'),('T220427400127900184511','2022-04-27 16:00:34'),('T220427400129940120380','2022-04-27 16:00:23'),('T220427400139720192986','2022-04-27 16:00:34'),('T220427400140260152375','2022-04-27 16:00:02'),('T220427400 [...] sql """ CREATE SQL_BLOCK_RULE if not exists test_rule_sql --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org