This is an automated email from the ASF dual-hosted git repository.
dataroaring 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 ee1be6edd7 [chore](fe) enhance_mysql_data_type (#17429)
ee1be6edd7 is described below
commit ee1be6edd7d55ae890d5cc87866686c7ed34e805
Author: AlexYue <[email protected]>
AuthorDate: Mon Mar 6 10:42:01 2023 +0800
[chore](fe) enhance_mysql_data_type (#17429)
---
be/src/exec/schema_scanner/schema_columns_scanner.cpp | 9 +++++++++
.../data/nereids_p0/system/test_query_sys_data_type.out | 4 ++++
.../data/query_p0/system/test_query_sys_data_type.out | 4 ++++
.../nereids_p0/system/test_query_sys_data_type.groovy | 17 +++++++++++++++++
.../query_p0/system/test_query_sys_data_type.groovy | 17 +++++++++++++++++
5 files changed, 51 insertions(+)
diff --git a/be/src/exec/schema_scanner/schema_columns_scanner.cpp
b/be/src/exec/schema_scanner/schema_columns_scanner.cpp
index 947a88f15e..6543eda827 100644
--- a/be/src/exec/schema_scanner/schema_columns_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_columns_scanner.cpp
@@ -142,6 +142,15 @@ std::string
SchemaColumnsScanner::_to_mysql_data_type_string(TColumnDesc& desc)
case TPrimitiveType::JSONB: {
return "json";
}
+ case TPrimitiveType::MAP: {
+ return "map";
+ }
+ case TPrimitiveType::ARRAY: {
+ return "array";
+ }
+ case TPrimitiveType::STRUCT: {
+ return "struct";
+ }
default:
return "unknown";
}
diff --git
a/regression-test/data/nereids_p0/system/test_query_sys_data_type.out
b/regression-test/data/nereids_p0/system/test_query_sys_data_type.out
index c5273d2c5c..952814c301 100644
--- a/regression-test/data/nereids_p0/system/test_query_sys_data_type.out
+++ b/regression-test/data/nereids_p0/system/test_query_sys_data_type.out
@@ -8,3 +8,7 @@ os char
set1 hll
set2 bitmap
+-- !sql --
+id int
+c_array array
+
diff --git a/regression-test/data/query_p0/system/test_query_sys_data_type.out
b/regression-test/data/query_p0/system/test_query_sys_data_type.out
index c5273d2c5c..952814c301 100644
--- a/regression-test/data/query_p0/system/test_query_sys_data_type.out
+++ b/regression-test/data/query_p0/system/test_query_sys_data_type.out
@@ -8,3 +8,7 @@ os char
set1 hll
set2 bitmap
+-- !sql --
+id int
+c_array array
+
diff --git
a/regression-test/suites/nereids_p0/system/test_query_sys_data_type.groovy
b/regression-test/suites/nereids_p0/system/test_query_sys_data_type.groovy
index 7164c1bde3..491791bc57 100644
--- a/regression-test/suites/nereids_p0/system/test_query_sys_data_type.groovy
+++ b/regression-test/suites/nereids_p0/system/test_query_sys_data_type.groovy
@@ -31,4 +31,21 @@ suite("test_query_sys_data_type", 'query,p0') {
"""
qt_sql "select column_name, data_type from information_schema.columns
where table_schema = '${dbName}' and table_name = '${tbName}'"
+
+ sql """ DROP TABLE IF EXISTS array_test """
+ sql """
+ CREATE TABLE `array_test` (
+ `id` int(11) NULL COMMENT "",
+ `c_array` ARRAY<int(11)> NULL COMMENT ""
+ ) ENGINE=OLAP
+ DUPLICATE KEY(`id`)
+ COMMENT "OLAP"
+ DISTRIBUTED BY HASH(`id`) BUCKETS 1
+ PROPERTIES (
+ "replication_allocation" = "tag.location.default: 1",
+ "in_memory" = "false",
+ "storage_format" = "V2"
+ )
+ """
+ qt_sql "select column_name, data_type from information_schema.columns
where table_schema = '${dbName}' and table_name = 'array_test'"
}
diff --git
a/regression-test/suites/query_p0/system/test_query_sys_data_type.groovy
b/regression-test/suites/query_p0/system/test_query_sys_data_type.groovy
index 237cbaa139..97f9926083 100644
--- a/regression-test/suites/query_p0/system/test_query_sys_data_type.groovy
+++ b/regression-test/suites/query_p0/system/test_query_sys_data_type.groovy
@@ -28,4 +28,21 @@ suite("test_query_sys_data_type", 'query,p0') {
"""
qt_sql "select column_name, data_type from information_schema.columns
where table_schema = '${dbName}' and table_name = '${tbName}'"
+
+ sql """ DROP TABLE IF EXISTS array_test """
+ sql """
+ CREATE TABLE `array_test` (
+ `id` int(11) NULL COMMENT "",
+ `c_array` ARRAY<int(11)> NULL COMMENT ""
+ ) ENGINE=OLAP
+ DUPLICATE KEY(`id`)
+ COMMENT "OLAP"
+ DISTRIBUTED BY HASH(`id`) BUCKETS 1
+ PROPERTIES (
+ "replication_allocation" = "tag.location.default: 1",
+ "in_memory" = "false",
+ "storage_format" = "V2"
+ )
+ """
+ qt_sql "select column_name, data_type from information_schema.columns
where table_schema = '${dbName}' and table_name = 'array_test'"
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]