You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2022/07/03 15:19:52 UTC
[doris] branch master updated: [fix] fix create table like when having sequence column (#10464)
This is an automated email from the ASF dual-hosted git repository.
morningman 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 8b6c46cfd1 [fix] fix create table like when having sequence column (#10464)
8b6c46cfd1 is described below
commit 8b6c46cfd1654b4f75def4f9f39e65cb99440e87
Author: xueweizhang <zx...@163.com>
AuthorDate: Sun Jul 3 23:19:46 2022 +0800
[fix] fix create table like when having sequence column (#10464)
---
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 7b79774fef..2798b2b36e 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
@@ -2872,6 +2872,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-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org