This is an automated email from the ASF dual-hosted git repository.

morrysnow 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 7c05ff8f2c5 [fix](desc) desc table all return wrong Type string for 
versioned type (#53663)
7c05ff8f2c5 is described below

commit 7c05ff8f2c5fcaa76f279eaf5ec9634e72f020e2
Author: morrySnow <[email protected]>
AuthorDate: Thu Jul 24 19:38:17 2025 +0800

    [fix](desc) desc table all return wrong Type string for versioned type 
(#53663)
    
    ### What problem does this PR solve?
    
    Problem Summary:
    
    before
    
+-----------+---------------+-------+------------------------+------------------------+------+-------+---------+-------+---------+------------+-------------+
    | IndexName | IndexKeysType | Field | Type                   | InternalType 
          | Null | Key   | Default | Extra | Visible | DefineExpr | WhereClause 
|
    
+-----------+---------------+-------+------------------------+------------------------+------+-------+---------+-------+---------+------------+-------------+
    | tarr      | DUP_KEYS      | id    | int                    | int          
          | Yes  | true  | <null>  |       | true    |            |             
|
    |           |               | c1    | array<decimalv3(20,5)> | 
array<decimalv3(20,5)> | Yes  | false | <null>  | NONE  | true    |            
|             |
    |           |               | c2    | array<datev2>          | 
array<datev2>          | Yes  | false | <null>  | NONE  | true    |            
|             |
    
+-----------+---------------+-------+------------------------+------------------------+------+-------+---------+-------+---------+------------+-------------+
    
    after
    
+-----------+---------------+-------+----------------------+------------------------+------+-------+---------+-------+---------+------------+-------------+
    | IndexName | IndexKeysType | Field | Type                 | InternalType   
        | Null | Key   | Default | Extra | Visible | DefineExpr | WhereClause |
    
+-----------+---------------+-------+----------------------+------------------------+------+-------+---------+-------+---------+------------+-------------+
    | tarr      | DUP_KEYS      | id    | int                  | int            
        | Yes  | true  | <null>  |       | true    |            |             |
    |           |               | c1    | array<decimal(20,5)> | 
array<decimalv3(20,5)> | Yes  | false | <null>  | NONE  | true    |            
|             |
    |           |               | c2    | array<date>          | array<datev2>  
        | Yes  | false | <null>  | NONE  | true    |            |             |
    
+-----------+---------------+-------+----------------------+------------------------+------+-------+---------+-------+---------+------------+-------------+
---
 .../trees/plans/commands/DescribeCommand.java      |  24 +--------------------
 .../datatype_p0/decimalv3/test_show_decimalv3.out  | Bin 487 -> 485 bytes
 .../data/ddl_p0/test_create_table_like.out         | Bin 1169 -> 1187 bytes
 .../data/manager/test_manager_interface_1.out      | Bin 717 -> 716 bytes
 .../data/nereids_syntax_p0/rollup/agg_date.out     | Bin 1454 -> 1454 bytes
 .../data/nereids_syntax_p0/rollup/hll/hll.out      | Bin 600 -> 600 bytes
 .../rollup/hll_with_light_sc/hll_with_light_sc.out | Bin 615 -> 615 bytes
 .../data/rollup/test_materialized_view_hll.out     | Bin 599 -> 599 bytes
 .../test_materialized_view_hll_with_light_sc.out   | Bin 614 -> 614 bytes
 .../data/rollup_p0/test_rollup_agg_date.out        | Bin 1453 -> 1453 bytes
 .../schema_change_modify_mv_column_type_agg.out    | Bin 1367 -> 1365 bytes
 .../schema_change_modify_mv_column_type.out        | Bin 7289 -> 7285 bytes
 .../schema_change_modify_mv_column_type2.out       | Bin 6355 -> 6353 bytes
 .../data/schema_change_p0/test_rename_rollup.out   | Bin 1364 -> 1364 bytes
 .../test_rename_single_col_tbl.out                 | Bin 196 -> 196 bytes
 15 files changed, 1 insertion(+), 23 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/DescribeCommand.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/DescribeCommand.java
index 33a84e926c6..bb874011cb6 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/DescribeCommand.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/DescribeCommand.java
@@ -326,7 +326,7 @@ public class DescribeCommand extends ShowCommand {
                                     "",
                                     "",
                                     column.getName(),
-                                    column.getOriginType().toString(),
+                                    
column.getOriginType().hideVersionForVersionColumn(true),
                                     column.getOriginType().toString(),
                                     column.isAllowNull() ? "Yes" : "No",
                                     ((Boolean) column.isKey()).toString(),
@@ -338,28 +338,6 @@ public class DescribeCommand extends ShowCommand {
                                     defineExprStr,
                                     "");
 
-                            if (column.getOriginType().isDatetimeV2()) {
-                                StringBuilder typeStr = new 
StringBuilder("DATETIME");
-                                if (((ScalarType) 
column.getOriginType()).getScalarScale() > 0) {
-                                    typeStr.append("(").append(((ScalarType) 
column.getOriginType()).getScalarScale())
-                                        .append(")");
-                                }
-                                row.set(3, typeStr.toString());
-                            } else if (column.getOriginType().isDateV2()) {
-                                row.set(3, "DATE");
-                            } else if (column.getOriginType().isDecimalV3()) {
-                                StringBuilder typeStr = new 
StringBuilder("DECIMAL");
-                                ScalarType sType = (ScalarType) 
column.getOriginType();
-                                int scale = sType.getScalarScale();
-                                int precision = sType.getScalarPrecision();
-                                // not default
-                                if (scale > 0 && precision != 9) {
-                                    
typeStr.append("(").append(precision).append(", ").append(scale)
-                                        .append(")");
-                                }
-                                row.set(3, typeStr.toString());
-                            }
-
                             if (j == 0) {
                                 row.set(0, indexName);
                                 row.set(1, indexMeta.getKeysType().name());
diff --git a/regression-test/data/datatype_p0/decimalv3/test_show_decimalv3.out 
b/regression-test/data/datatype_p0/decimalv3/test_show_decimalv3.out
index df199714b70..25f666c4114 100644
Binary files 
a/regression-test/data/datatype_p0/decimalv3/test_show_decimalv3.out and 
b/regression-test/data/datatype_p0/decimalv3/test_show_decimalv3.out differ
diff --git a/regression-test/data/ddl_p0/test_create_table_like.out 
b/regression-test/data/ddl_p0/test_create_table_like.out
index 07f4254ab32..aedc9c13392 100644
Binary files a/regression-test/data/ddl_p0/test_create_table_like.out and 
b/regression-test/data/ddl_p0/test_create_table_like.out differ
diff --git a/regression-test/data/manager/test_manager_interface_1.out 
b/regression-test/data/manager/test_manager_interface_1.out
index 0a432e959cc..720adbaad85 100644
Binary files a/regression-test/data/manager/test_manager_interface_1.out and 
b/regression-test/data/manager/test_manager_interface_1.out differ
diff --git a/regression-test/data/nereids_syntax_p0/rollup/agg_date.out 
b/regression-test/data/nereids_syntax_p0/rollup/agg_date.out
index 3c85f24c2e6..1ef9e3d7656 100644
Binary files a/regression-test/data/nereids_syntax_p0/rollup/agg_date.out and 
b/regression-test/data/nereids_syntax_p0/rollup/agg_date.out differ
diff --git a/regression-test/data/nereids_syntax_p0/rollup/hll/hll.out 
b/regression-test/data/nereids_syntax_p0/rollup/hll/hll.out
index 28613c99b80..c376c2cc04a 100644
Binary files a/regression-test/data/nereids_syntax_p0/rollup/hll/hll.out and 
b/regression-test/data/nereids_syntax_p0/rollup/hll/hll.out differ
diff --git 
a/regression-test/data/nereids_syntax_p0/rollup/hll_with_light_sc/hll_with_light_sc.out
 
b/regression-test/data/nereids_syntax_p0/rollup/hll_with_light_sc/hll_with_light_sc.out
index b348514c97b..8fe664179c9 100644
Binary files 
a/regression-test/data/nereids_syntax_p0/rollup/hll_with_light_sc/hll_with_light_sc.out
 and 
b/regression-test/data/nereids_syntax_p0/rollup/hll_with_light_sc/hll_with_light_sc.out
 differ
diff --git a/regression-test/data/rollup/test_materialized_view_hll.out 
b/regression-test/data/rollup/test_materialized_view_hll.out
index 99dcf35a1ce..d9611809aac 100644
Binary files a/regression-test/data/rollup/test_materialized_view_hll.out and 
b/regression-test/data/rollup/test_materialized_view_hll.out differ
diff --git 
a/regression-test/data/rollup/test_materialized_view_hll_with_light_sc.out 
b/regression-test/data/rollup/test_materialized_view_hll_with_light_sc.out
index 1cbbfd15953..7d106fbf7c8 100644
Binary files 
a/regression-test/data/rollup/test_materialized_view_hll_with_light_sc.out and 
b/regression-test/data/rollup/test_materialized_view_hll_with_light_sc.out 
differ
diff --git a/regression-test/data/rollup_p0/test_rollup_agg_date.out 
b/regression-test/data/rollup_p0/test_rollup_agg_date.out
index dddd46df900..689a7be1afb 100644
Binary files a/regression-test/data/rollup_p0/test_rollup_agg_date.out and 
b/regression-test/data/rollup_p0/test_rollup_agg_date.out differ
diff --git 
a/regression-test/data/schema_change_p0/modify_col_type_agg/schema_change_modify_mv_column_type_agg.out
 
b/regression-test/data/schema_change_p0/modify_col_type_agg/schema_change_modify_mv_column_type_agg.out
index c8e17282628..6284c657da7 100644
Binary files 
a/regression-test/data/schema_change_p0/modify_col_type_agg/schema_change_modify_mv_column_type_agg.out
 and 
b/regression-test/data/schema_change_p0/modify_col_type_agg/schema_change_modify_mv_column_type_agg.out
 differ
diff --git 
a/regression-test/data/schema_change_p0/modify_col_type_dup/schema_change_modify_mv_column_type.out
 
b/regression-test/data/schema_change_p0/modify_col_type_dup/schema_change_modify_mv_column_type.out
index 2c3de71bc3d..5b674bef12f 100644
Binary files 
a/regression-test/data/schema_change_p0/modify_col_type_dup/schema_change_modify_mv_column_type.out
 and 
b/regression-test/data/schema_change_p0/modify_col_type_dup/schema_change_modify_mv_column_type.out
 differ
diff --git 
a/regression-test/data/schema_change_p0/modify_col_type_dup2/schema_change_modify_mv_column_type2.out
 
b/regression-test/data/schema_change_p0/modify_col_type_dup2/schema_change_modify_mv_column_type2.out
index 024ed9d867e..72222cde021 100644
Binary files 
a/regression-test/data/schema_change_p0/modify_col_type_dup2/schema_change_modify_mv_column_type2.out
 and 
b/regression-test/data/schema_change_p0/modify_col_type_dup2/schema_change_modify_mv_column_type2.out
 differ
diff --git a/regression-test/data/schema_change_p0/test_rename_rollup.out 
b/regression-test/data/schema_change_p0/test_rename_rollup.out
index 6e406ff098f..2aba846a861 100644
Binary files a/regression-test/data/schema_change_p0/test_rename_rollup.out and 
b/regression-test/data/schema_change_p0/test_rename_rollup.out differ
diff --git 
a/regression-test/data/schema_change_p0/test_rename_single_col_tbl.out 
b/regression-test/data/schema_change_p0/test_rename_single_col_tbl.out
index aea2129c772..eeeaf5270b4 100644
Binary files 
a/regression-test/data/schema_change_p0/test_rename_single_col_tbl.out and 
b/regression-test/data/schema_change_p0/test_rename_single_col_tbl.out differ


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to