This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.0 by this push:
new 34f9306f3cc branch-4.0: [fix](nereids) show columns type hide Column
Version #59684 (#60077)
34f9306f3cc is described below
commit 34f9306f3ccbe163aa67b3e65e9056a7f6b8d3f3
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Jan 21 05:27:24 2026 +0800
branch-4.0: [fix](nereids) show columns type hide Column Version #59684
(#60077)
Cherry-picked from #59684
Co-authored-by: catpineapple <[email protected]>
---
.../org/apache/doris/datasource/jdbc/client/JdbcMySQLClient.java | 2 +-
.../doris/nereids/trees/plans/commands/ShowColumnsCommand.java | 2 +-
.../data/external_table_p0/jdbc/test_doris_jdbc_catalog.out | 2 +-
regression-test/data/nereids_p0/show/test_show_columns_command.out | 6 ++++++
.../suites/nereids_p0/show/test_show_columns_command.groovy | 5 ++++-
5 files changed, 13 insertions(+), 4 deletions(-)
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 09208fd4c21..3d6338d2f04 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 @@ public class JdbcMySQLClient extends JdbcClient {
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 cdc7804afce..4b4e2928af6 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 class ShowColumnsCommand extends ShowCommand {
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/external_table_p0/jdbc/test_doris_jdbc_catalog.out
b/regression-test/data/external_table_p0/jdbc/test_doris_jdbc_catalog.out
index a8fd900364a..43335323590 100644
--- a/regression-test/data/external_table_p0/jdbc/test_doris_jdbc_catalog.out
+++ b/regression-test/data/external_table_p0/jdbc/test_doris_jdbc_catalog.out
@@ -136,7 +136,7 @@ double_col double Yes true \N NONE
decimal_col decimal(10,5) Yes true \N NONE
decimal_col2 decimal(30,10) Yes true \N NONE
date_col date Yes true \N NONE
-datetime_col datetime(6) Yes true \N NONE
+datetime_col datetime Yes true \N NONE
char_col char(85) Yes true \N NONE
varchar_col char(85) Yes true \N NONE
json_col text Yes true \N NONE
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 950d64388a3..f56e7bb6e25 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 3d21cd9b6f1..071198cb35d 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");
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]