This is an automated email from the ASF dual-hosted git repository.
zykkk 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 41ff48f838 [regresstion][external]fix case test_show_where and
es_query 0811 (#22898)
41ff48f838 is described below
commit 41ff48f8387c72327567f58103c918ff97cea02a
Author: zhangguoqiang <[email protected]>
AuthorDate: Sat Aug 12 19:41:55 2023 +0800
[regresstion][external]fix case test_show_where and es_query 0811 (#22898)
---
.../docker-compose/mysql/init/01-drop-db.sql | 1 +
.../docker-compose/mysql/init/02-create-db.sql | 1 +
.../docker-compose/mysql/init/03-create-table.sql | 13 +++++++
.../docker-compose/mysql/init/04-insert.sql | 6 +++
.../hive/test_truncate_char_or_varchar_columns.out | 0
.../data/nereids_p0/show/test_show_where.out | 44 ++++++++++++++++++++++
.../data/query_p0/show/test_show_where.out | 44 ++++++++++++++++++++++
.../es/test_es_query_no_http_url.groovy | 25 ++++++------
.../test_truncate_char_or_varchar_columns.groovy | 2 +-
.../suites/nereids_p0/show/test_show_where.groovy | 15 ++++----
.../suites/query_p0/show/test_show_where.groovy | 15 ++++----
11 files changed, 139 insertions(+), 27 deletions(-)
diff --git a/docker/thirdparties/docker-compose/mysql/init/01-drop-db.sql
b/docker/thirdparties/docker-compose/mysql/init/01-drop-db.sql
index d0db4a7e1a..a1f48660b5 100644
--- a/docker/thirdparties/docker-compose/mysql/init/01-drop-db.sql
+++ b/docker/thirdparties/docker-compose/mysql/init/01-drop-db.sql
@@ -16,3 +16,4 @@
-- under the License.
drop database if exists doris_test;
+drop database if exists show_test_do_not_modify;
diff --git a/docker/thirdparties/docker-compose/mysql/init/02-create-db.sql
b/docker/thirdparties/docker-compose/mysql/init/02-create-db.sql
index f87b6922d9..84d7db5627 100644
--- a/docker/thirdparties/docker-compose/mysql/init/02-create-db.sql
+++ b/docker/thirdparties/docker-compose/mysql/init/02-create-db.sql
@@ -16,3 +16,4 @@
-- under the License.
create database doris_test;
+create database show_test_do_not_modify;
diff --git a/docker/thirdparties/docker-compose/mysql/init/03-create-table.sql
b/docker/thirdparties/docker-compose/mysql/init/03-create-table.sql
index 0b5b6bb636..4663ea2cf6 100644
--- a/docker/thirdparties/docker-compose/mysql/init/03-create-table.sql
+++ b/docker/thirdparties/docker-compose/mysql/init/03-create-table.sql
@@ -308,3 +308,16 @@ CREATE TABLE doris_test.dt_null (
CREATE VIEW doris_test.mysql_view as
select 10086 as col_1, 4294967295 as col_2, tinyint_u as col_3 from
doris_test.all_types where tinyint_u=201;
+CREATE TABLE show_test_do_not_modify.ex_tb0 (
+ `id` int PRIMARY KEY,
+ `name` varchar(128)
+);
+
+CREATE TABLE show_test_do_not_modify.ex_tb1 (
+ id varchar(128)
+);
+
+CREATE TABLE show_test_do_not_modify.ex_tb2 (
+ id int,
+ count_value varchar(20)
+);
diff --git a/docker/thirdparties/docker-compose/mysql/init/04-insert.sql
b/docker/thirdparties/docker-compose/mysql/init/04-insert.sql
index fbbe2221bb..93ae8c9b63 100644
--- a/docker/thirdparties/docker-compose/mysql/init/04-insert.sql
+++ b/docker/thirdparties/docker-compose/mysql/init/04-insert.sql
@@ -15,6 +15,12 @@
-- specific language governing permissions and limitations
-- under the License.
+insert into show_test_do_not_modify.ex_tb0 values (111, 'abc'), (112, 'abd'),
(113, 'abe'),(114, 'abf'),(115, 'abg');
+
+insert into show_test_do_not_modify.ex_tb1 values ('{"k1":"v1", "k2":"v2"}');
+
+insert into show_test_do_not_modify.ex_tb2 values (123, '10'), (123, '15'),
(123, '20');
+
insert into doris_test.test1 values
(true, 'abc', 'efg', '2022-10-01', 3.4, 1, 2, 0, 100000, 1.2, '2022-10-02
12:59:01', 24.000),
(true, 'abc', 'efg', '2022-10-01', 3.4, 1, 2, 1, 100000, 1.2, '2022-10-02
12:59:01', 24.000),
diff --git
a/regression-test/data/external_table_emr_p2/hive/test_truncate_char_or_varchar_columns.out
b/regression-test/data/external_table_p2/hive/test_truncate_char_or_varchar_columns.out
similarity index 100%
rename from
regression-test/data/external_table_emr_p2/hive/test_truncate_char_or_varchar_columns.out
rename to
regression-test/data/external_table_p2/hive/test_truncate_char_or_varchar_columns.out
diff --git a/regression-test/data/nereids_p0/show/test_show_where.out
b/regression-test/data/nereids_p0/show/test_show_where.out
index 6e51af956f..538d5c23ab 100644
--- a/regression-test/data/nereids_p0/show/test_show_where.out
+++ b/regression-test/data/nereids_p0/show/test_show_where.out
@@ -17,3 +17,47 @@ ex_tb1
ex_tb0
ex_tb1
+-- !select --
+show_test_do_not_modify
+
+-- !select --
+ex_tb0
+ex_tb1
+ex_tb2
+
+-- !select --
+ex_tb0
+
+-- !select --
+ex_tb0
+ex_tb1
+ex_tb2
+
+-- !select --
+ex_tb0
+ex_tb1
+
+-- !select --
+ex_tb0
+ex_tb1
+ex_tb2
+
+-- !select --
+doris_test
+
+-- !select --
+ex_tb0
+ex_tb1
+
+-- !select --
+ex_tb1
+
+-- !select --
+ex_tb0
+ex_tb1
+
+-- !select --
+ex_tb0
+ex_tb1
+ex_tb2
+
diff --git a/regression-test/data/query_p0/show/test_show_where.out
b/regression-test/data/query_p0/show/test_show_where.out
index 6e51af956f..538d5c23ab 100644
--- a/regression-test/data/query_p0/show/test_show_where.out
+++ b/regression-test/data/query_p0/show/test_show_where.out
@@ -17,3 +17,47 @@ ex_tb1
ex_tb0
ex_tb1
+-- !select --
+show_test_do_not_modify
+
+-- !select --
+ex_tb0
+ex_tb1
+ex_tb2
+
+-- !select --
+ex_tb0
+
+-- !select --
+ex_tb0
+ex_tb1
+ex_tb2
+
+-- !select --
+ex_tb0
+ex_tb1
+
+-- !select --
+ex_tb0
+ex_tb1
+ex_tb2
+
+-- !select --
+doris_test
+
+-- !select --
+ex_tb0
+ex_tb1
+
+-- !select --
+ex_tb1
+
+-- !select --
+ex_tb0
+ex_tb1
+
+-- !select --
+ex_tb0
+ex_tb1
+ex_tb2
+
diff --git
a/regression-test/suites/external_table_p0/es/test_es_query_no_http_url.groovy
b/regression-test/suites/external_table_p0/es/test_es_query_no_http_url.groovy
index 07c39ccf11..7aad2f4fba 100644
---
a/regression-test/suites/external_table_p0/es/test_es_query_no_http_url.groovy
+++
b/regression-test/suites/external_table_p0/es/test_es_query_no_http_url.groovy
@@ -32,8 +32,7 @@ suite("test_es_query_no_http_url",
"p0,external,es,external_docker,external_dock
// test old create-catalog syntax for compatibility
sql """
- create catalog es6
- properties (
+ create catalog if not exists es6 properties (
"type"="es",
"elasticsearch.hosts"="${externalEnvIp}:$es_6_port",
"elasticsearch.nodes_discovery"="false",
@@ -42,19 +41,21 @@ suite("test_es_query_no_http_url",
"p0,external,es,external_docker,external_dock
"""
// test new create catalog syntax
- sql """create catalog if not exists es7 properties(
- "type"="es",
- "hosts"="${externalEnvIp}:$es_7_port",
- "nodes_discovery"="false",
- "enable_keyword_sniff"="true"
+ sql """
+ create catalog if not exists es7 properties(
+ "type"="es",
+ "hosts"="${externalEnvIp}:$es_7_port",
+ "nodes_discovery"="false",
+ "enable_keyword_sniff"="true"
);
"""
- sql """create catalog if not exists es8 properties(
- "type"="es",
- "hosts"="${externalEnvIp}:$es_8_port",
- "nodes_discovery"="false",
- "enable_keyword_sniff"="true"
+ sql """
+ create catalog if not exists es8 properties(
+ "type"="es",
+ "hosts"="${externalEnvIp}:$es_8_port",
+ "nodes_discovery"="false",
+ "enable_keyword_sniff"="true"
);
"""
diff --git
a/regression-test/suites/external_table_emr_p2/hive/test_truncate_char_or_varchar_columns.groovy
b/regression-test/suites/external_table_p2/hive/test_truncate_char_or_varchar_columns.groovy
similarity index 97%
rename from
regression-test/suites/external_table_emr_p2/hive/test_truncate_char_or_varchar_columns.groovy
rename to
regression-test/suites/external_table_p2/hive/test_truncate_char_or_varchar_columns.groovy
index 4fdf7183c6..4ed6814e03 100644
---
a/regression-test/suites/external_table_emr_p2/hive/test_truncate_char_or_varchar_columns.groovy
+++
b/regression-test/suites/external_table_p2/hive/test_truncate_char_or_varchar_columns.groovy
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-suite("test_truncate_char_or_varchar_columns", "p2") {
+suite("test_truncate_char_or_varchar_columns",
"p2,external,hive,external_remote,external_remote_hive") {
String enabled = context.config.otherConfigs.get("enableExternalHiveTest")
if (enabled != null && enabled.equalsIgnoreCase("true")) {
String extHiveHmsHost =
context.config.otherConfigs.get("extHiveHmsHost")
diff --git a/regression-test/suites/nereids_p0/show/test_show_where.groovy
b/regression-test/suites/nereids_p0/show/test_show_where.groovy
index 5f555a4e72..2caf494bf2 100644
--- a/regression-test/suites/nereids_p0/show/test_show_where.groovy
+++ b/regression-test/suites/nereids_p0/show/test_show_where.groovy
@@ -58,7 +58,8 @@ suite("test_show_where",
"query,external,mysql,external_docker,external_docker_m
String enabled = context.config.otherConfigs.get("enableJdbcTest")
String mysql_port = context.config.otherConfigs.get("mysql_57_port");
if (enabled != null && enabled.equalsIgnoreCase("true")) {
-
+ String mysql_show_db="show_test_do_not_modify"
+
sql """drop catalog if exists ${catalog_name} """
// if use 'com.mysql.cj.jdbc.Driver' here, it will report:
ClassNotFound
@@ -66,20 +67,20 @@ suite("test_show_where",
"query,external,mysql,external_docker,external_docker_m
"type"="jdbc",
"jdbc.user"="root",
"jdbc.password"="123456",
- "jdbc.jdbc_url" =
"jdbc:mysql://${externalEnvIp}:${mysql_port}/doris_test?useSSL=false",
+ "jdbc.jdbc_url" =
"jdbc:mysql://${externalEnvIp}:${mysql_port}/show_test_do_not_modify?useSSL=false",
"jdbc.driver_url" = "${driver_url}",
"jdbc.driver_class" = "com.mysql.cj.jdbc.Driver");
"""
sql """switch ${catalog_name}"""
- sql """ use ${ex_db_name}"""
+ sql """ use ${mysql_show_db}"""
- qt_select "show databases where schema_name= '${ex_db_name}'"
+ qt_select "show databases where schema_name= '${mysql_show_db}'"
qt_select "show tables"
qt_select "show tables where table_name= '${ex_tb0}'"
- qt_select "show tables from ${ex_db_name}"
+ qt_select "show tables from ${mysql_show_db}"
qt_select "show tables from internal.${ex_db_name}"
- qt_select "show tables from ${catalog_name}.${ex_db_name}"
+ qt_select "show tables from ${catalog_name}.${mysql_show_db}"
sql """switch internal"""
@@ -89,7 +90,7 @@ suite("test_show_where",
"query,external,mysql,external_docker,external_docker_m
qt_select "show tables"
qt_select "show tables where table_name= '${ex_tb1}'"
qt_select "show tables from internal.${ex_db_name}"
- qt_select "show tables from ${catalog_name}.${ex_db_name}"
+ qt_select "show tables from ${catalog_name}.${mysql_show_db}"
}
diff --git a/regression-test/suites/query_p0/show/test_show_where.groovy
b/regression-test/suites/query_p0/show/test_show_where.groovy
index 9fac7148fe..1a48f5c926 100644
--- a/regression-test/suites/query_p0/show/test_show_where.groovy
+++ b/regression-test/suites/query_p0/show/test_show_where.groovy
@@ -56,7 +56,8 @@ suite("test_show_where",
"query,external,mysql,external_docker,external_docker_m
String enabled = context.config.otherConfigs.get("enableJdbcTest")
String mysql_port = context.config.otherConfigs.get("mysql_57_port");
if (enabled != null && enabled.equalsIgnoreCase("true")) {
-
+ String mysql_show_db="show_test_do_not_modify"
+
sql """drop catalog if exists ${catalog_name} """
// if use 'com.mysql.cj.jdbc.Driver' here, it will report:
ClassNotFound
@@ -64,20 +65,20 @@ suite("test_show_where",
"query,external,mysql,external_docker,external_docker_m
"type"="jdbc",
"jdbc.user"="root",
"jdbc.password"="123456",
- "jdbc.jdbc_url" =
"jdbc:mysql://${externalEnvIp}:${mysql_port}/doris_test?useSSL=false",
+ "jdbc.jdbc_url" =
"jdbc:mysql://${externalEnvIp}:${mysql_port}/show_test_do_not_modify?useSSL=false",
"jdbc.driver_url" = "${driver_url}",
"jdbc.driver_class" = "com.mysql.cj.jdbc.Driver");
"""
sql """switch ${catalog_name}"""
- sql """ use ${ex_db_name}"""
+ sql """ use ${mysql_show_db}"""
- qt_select "show databases where schema_name= '${ex_db_name}'"
+ qt_select "show databases where schema_name= '${mysql_show_db}'"
qt_select "show tables"
qt_select "show tables where table_name= '${ex_tb0}'"
- qt_select "show tables from ${ex_db_name}"
+ qt_select "show tables from ${mysql_show_db}"
qt_select "show tables from internal.${ex_db_name}"
- qt_select "show tables from ${catalog_name}.${ex_db_name}"
+ qt_select "show tables from ${catalog_name}.${mysql_show_db}"
sql """switch internal"""
@@ -87,7 +88,7 @@ suite("test_show_where",
"query,external,mysql,external_docker,external_docker_m
qt_select "show tables"
qt_select "show tables where table_name= '${ex_tb1}'"
qt_select "show tables from internal.${ex_db_name}"
- qt_select "show tables from ${catalog_name}.${ex_db_name}"
+ qt_select "show tables from ${catalog_name}.${mysql_show_db}"
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]