diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcMySQLClient.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcMySQLClient.java index 09208fd4c2157c..3d6338d2f04728 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcMySQLClient.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcMySQLClient.java @@ -422,7 +422,7 @@ private Type dorisTypeToDoris(JdbcFieldSchema fieldSchema) { return ScalarType.createDateV2Type(); case "DATETIME": case "DATETIMEV2": { - int scale = (openParen == -1) ? 6 + int scale = (openParen == -1) ? 0 : Integer.parseInt(upperType.substring(openParen + 1, upperType.length() - 1)); if (scale > 6) { scale = 6; diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowColumnsCommand.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowColumnsCommand.java index f8d1e2421dfb13..221482dba7d5a6 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowColumnsCommand.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowColumnsCommand.java @@ -190,7 +190,7 @@ public ShowResultSet doRun(ConnectContext ctx, StmtExecutor executor) throws Exc continue; } final String columnName = col.getName(); - final String columnType = col.getOriginType().toString().toLowerCase(Locale.ROOT); + final String columnType = col.getOriginType().hideVersionForVersionColumn(false); final String isAllowNull = col.isAllowNull() ? "YES" : "NO"; final String isKey = col.isKey() ? "YES" : "NO"; final String defaultValue = col.getDefaultValue(); diff --git a/regression-test/data/nereids_p0/show/test_show_columns_command.out b/regression-test/data/nereids_p0/show/test_show_columns_command.out index 950d64388a35cf..f56e7bb6e251bc 100644 --- a/regression-test/data/nereids_p0/show/test_show_columns_command.out +++ b/regression-test/data/nereids_p0/show/test_show_columns_command.out @@ -3,11 +3,17 @@ id int YES YES \N name text YES NO \N NONE score float YES NO \N NONE +event_date date YES NO \N NONE +event_time datetime YES NO \N NONE +decimal_col decimal(10,2) YES NO \N NONE -- !cmd -- id int YES YES \N name text YES NO \N NONE score float YES NO \N NONE +event_date date YES NO \N NONE +event_time datetime YES NO \N NONE +decimal_col decimal(10,2) YES NO \N NONE -- !cmd -- score float YES NO \N NONE diff --git a/regression-test/suites/nereids_p0/show/test_show_columns_command.groovy b/regression-test/suites/nereids_p0/show/test_show_columns_command.groovy index 3d21cd9b6f11f5..071198cb35df45 100644 --- a/regression-test/suites/nereids_p0/show/test_show_columns_command.groovy +++ b/regression-test/suites/nereids_p0/show/test_show_columns_command.groovy @@ -25,7 +25,10 @@ suite("test_show_columns_command", "nereids_p0") { CREATE TABLE IF NOT EXISTS ${dbName}.${tableName} ( id INT, name STRING, - score FLOAT + score FLOAT, + event_date DATE, + event_time DATETIME, + decimal_col DECIMAL(10, 2) ) DISTRIBUTED BY HASH(id) BUCKETS 3 PROPERTIES ("replication_num" = "1");