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 58508aea13 [enhance](information_schema) show hll type and bitmap type 
instead of unknown (#12519)
58508aea13 is described below

commit 58508aea13341af659bddf7701d126241573e60b
Author: AlexYue <yj976240...@qq.com>
AuthorDate: Tue Sep 13 19:43:42 2022 +0800

    [enhance](information_schema) show hll type and bitmap type instead of 
unknown (#12519)
    
    Before this pr, when querying data type of hll/bitmap column, 'unknown' 
would be returned instead of the correct data type of queried column.
---
 .../exec/schema_scanner/schema_columns_scanner.cpp | 12 +++++++++
 .../data/query/system/test_query_sys_data_type.out | 10 +++++++
 .../query/system/test_query_sys_data_type.groovy   | 31 ++++++++++++++++++++++
 3 files changed, 53 insertions(+)

diff --git a/be/src/exec/schema_scanner/schema_columns_scanner.cpp 
b/be/src/exec/schema_scanner/schema_columns_scanner.cpp
index 6102e128af..35d6f28518 100644
--- a/be/src/exec/schema_scanner/schema_columns_scanner.cpp
+++ b/be/src/exec/schema_scanner/schema_columns_scanner.cpp
@@ -122,6 +122,12 @@ std::string 
SchemaColumnsScanner::to_mysql_data_type_string(TColumnDesc& desc) {
     case TPrimitiveType::DECIMALV2: {
         return "decimal";
     }
+    case TPrimitiveType::HLL: {
+        return "hll";
+    }
+    case TPrimitiveType::OBJECT: {
+        return "bitmap";
+    }
     default:
         return "unknown";
     }
@@ -180,6 +186,12 @@ std::string 
SchemaColumnsScanner::type_to_string(TColumnDesc& desc) {
         stream << ")";
         return stream.str();
     }
+    case TPrimitiveType::HLL: {
+        return "hll";
+    }
+    case TPrimitiveType::OBJECT: {
+        return "bitmap";
+    }
     default:
         return "unknown";
     }
diff --git a/regression-test/data/query/system/test_query_sys_data_type.out 
b/regression-test/data/query/system/test_query_sys_data_type.out
new file mode 100644
index 0000000000..c5273d2c5c
--- /dev/null
+++ b/regression-test/data/query/system/test_query_sys_data_type.out
@@ -0,0 +1,10 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !sql --
+dt     date
+id     int
+name   char
+province       char
+os     char
+set1   hll
+set2   bitmap
+
diff --git 
a/regression-test/suites/query/system/test_query_sys_data_type.groovy 
b/regression-test/suites/query/system/test_query_sys_data_type.groovy
new file mode 100644
index 0000000000..81ae6f5571
--- /dev/null
+++ b/regression-test/suites/query/system/test_query_sys_data_type.groovy
@@ -0,0 +1,31 @@
+// 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_query_sys_data_type", 'query,p0') {
+    def tbName = "test_data_type"
+    def dbName = "test_query_db"
+    sql "CREATE DATABASE IF NOT EXISTS ${dbName}"
+    sql "USE ${dbName}"
+
+    sql """ DROP TABLE IF EXISTS ${tbName} """
+    sql """
+        create table ${tbName} (dt date, id int, name char(10), province 
char(10), os char(1), set1 hll hll_union, set2 bitmap bitmap_union)
+        distributed by hash(id) buckets 1 properties("replication_num"="1");
+    """
+
+    qt_sql "select column_name, data_type from information_schema.columns 
where table_schema = '${dbName}' and table_name = '${tbName}'"
+}
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to