This is an automated email from the ASF dual-hosted git repository.
catpineapple 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 8ae511e7ec6 [fix](nereids) show columns type hide Column Version
(#59684)
8ae511e7ec6 is described below
commit 8ae511e7ec67fc677d7da2f273bbe368e0a34d04
Author: catpineapple <[email protected]>
AuthorDate: Tue Jan 20 17:07:15 2026 +0800
[fix](nereids) show columns type hide Column Version (#59684)
### What problem does this PR solve?
This update fixes an issue where the `SHOW FULL COLUMNS` statement still
displayed `version` for `date`, `datetime`, and `decimal` data types.
This change aims for better compatibility with MySQL behavior and BI
applications.
```txt
MySQL [(none)]> SHOW FULL COLUMNS FROM `doris_all_types_demo` FROM `tpch`;
+---------------------------+---------------+-----------+------+------+---------+-------+------------+-----------------------------------------------------+
| Field | Type | Collation | Null | Key |
Default | Extra | Privileges | Comment
|
+---------------------------+---------------+-----------+------+------+---------+-------+------------+-----------------------------------------------------+
| col_09_decimal | decimal(10,2) | | YES | NO |
NULL | NONE | | DECIMAL: exact decimal (precision, scale)
|
| col_14_date | date | | YES | NO |
NULL | NONE | | DATE: date format YYYY-MM-DD
|
| col_15_datetime | datetime | | YES | NO |
NULL | NONE | | DATETIME: datetime format YYYY-MM-DD HH:MM:SS
|
| col_16_datetime_precision | datetime(3) | | YES | NO |
NULL | NONE | | DATETIME(3): datetime with millisecond precision
|
+---------------------------+---------------+-----------+------+------+---------+-------+------------+-----------------------------------------------------+
```
Related PR: #xxx
Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [x] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [x] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
---
.../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 f8d1e2421df..221482dba7d 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]