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

yiguolei pushed a commit to branch branch-1.1-lts
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-1.1-lts by this push:
     new 0237208b9a [fix](ddl) fix create table like when having sequence 
column (#10464) (#14511)
0237208b9a is described below

commit 0237208b9a2ee25ea89fc1ca84b54ae452965bd4
Author: xueweizhang <zxw520bl...@163.com>
AuthorDate: Wed Nov 23 14:03:51 2022 +0800

    [fix](ddl) fix create table like when having sequence column (#10464) 
(#14511)
---
 fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java     | 7 +++++++
 regression-test/data/data_model/unique/test_unique_table_like.out  | 2 ++
 .../suites/data_model/unique/test_unique_table_like.groovy         | 3 ++-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java
index dace42f938..1f94ae0559 100755
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java
@@ -4322,6 +4322,13 @@ public class Catalog {
                 sb.append(olapTable.getCompressionType()).append("\"");
             }
 
+            // sequence type
+            if (olapTable.hasSequenceCol()) {
+                
sb.append(",\n\"").append(PropertyAnalyzer.PROPERTIES_FUNCTION_COLUMN + "."
+                    + PropertyAnalyzer.PROPERTIES_SEQUENCE_TYPE).append("\" = 
\"");
+                sb.append(olapTable.getSequenceType().toString()).append("\"");
+            }
+
             sb.append("\n)");
         } else if (table.getType() == TableType.MYSQL) {
             MysqlTable mysqlTable = (MysqlTable) table;
diff --git a/regression-test/data/data_model/unique/test_unique_table_like.out 
b/regression-test/data/data_model/unique/test_unique_table_like.out
index ffcbaf18cc..d728d493c7 100644
--- a/regression-test/data/data_model/unique/test_unique_table_like.out
+++ b/regression-test/data/data_model/unique/test_unique_table_like.out
@@ -5,6 +5,7 @@ int_value       INT     Yes     false   \N      REPLACE
 char_value     CHAR(10)        Yes     false   \N      REPLACE
 date_value     DATE    Yes     false   \N      REPLACE
 __DORIS_DELETE_SIGN__  TINYINT No      false   0       REPLACE
+__DORIS_SEQUENCE_COL__ INT     Yes     false   \N      REPLACE
 
 -- !desc_uniq_table --
 k      INT     Yes     true    \N      
@@ -12,4 +13,5 @@ int_value     INT     Yes     false   \N      REPLACE
 char_value     CHAR(10)        Yes     false   \N      REPLACE
 date_value     DATE    Yes     false   \N      REPLACE
 __DORIS_DELETE_SIGN__  TINYINT No      false   0       REPLACE
+__DORIS_SEQUENCE_COL__ INT     Yes     false   \N      REPLACE
 
diff --git 
a/regression-test/suites/data_model/unique/test_unique_table_like.groovy 
b/regression-test/suites/data_model/unique/test_unique_table_like.groovy
index 6250b61138..0bdc5e93b1 100644
--- a/regression-test/suites/data_model/unique/test_unique_table_like.groovy
+++ b/regression-test/suites/data_model/unique/test_unique_table_like.groovy
@@ -38,7 +38,8 @@ suite("test_unique_table_like", "data_model") {
             )
             ENGINE=OLAP
             UNIQUE KEY(k)
-            DISTRIBUTED BY HASH(k) BUCKETS 5 properties("replication_num" = 
"1");
+            DISTRIBUTED BY HASH(k) BUCKETS 5 properties("replication_num" = 
"1",
+                "function_column.sequence_type" = "int");
         """
     qt_desc_uniq_table "desc ${tbNameA}"    
     sql """


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

Reply via email to