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 7dd96bc341 [fix](olap) remove zorder support when create table (#18698)
7dd96bc341 is described below

commit 7dd96bc34122f78808c3f0fbfeaa087463feb2a0
Author: xueweizhang <[email protected]>
AuthorDate: Sun Apr 16 09:24:18 2023 +0800

    [fix](olap) remove zorder support when create table (#18698)
---
 .../Create/CREATE-TABLE.md                         |  6 -----
 .../Create/CREATE-TABLE.md                         |  8 +-----
 .../apache/doris/common/util/PropertyAnalyzer.java | 15 ++---------
 .../org/apache/doris/catalog/CreateTableTest.java  | 30 ++++++++++++----------
 4 files changed, 20 insertions(+), 39 deletions(-)

diff --git 
a/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-TABLE.md
 
b/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-TABLE.md
index 0b8fe85508..224aba899d 100644
--- 
a/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-TABLE.md
+++ 
b/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-TABLE.md
@@ -377,12 +377,6 @@ distribution_desc
         * `dynamic_partition.history_partition_num`: Specify the number of 
historical partitions to be created.
         * `dynamic_partition.reserved_history_periods`: Used to specify the 
range of reserved history periods.
     
-    * Data Sort Info
-    
-        The relevant parameters of data sort info are as follows:
-    
-        * `data_sort.sort_type`: the method of data sorting, options: 
z-order/lexical, default is lexical
-        * `data_sort.col_num`:  the first few columns to sort, col_num muster 
less than total key counts
 ### Example
 
 1. Create a detailed model table
diff --git 
a/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-TABLE.md
 
b/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-TABLE.md
index 0fd0780665..87ec09184f 100644
--- 
a/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-TABLE.md
+++ 
b/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-TABLE.md
@@ -373,13 +373,7 @@ distribution_desc
         * `dynamic_partition.create_history_partition`: 是否创建历史分区。
         * `dynamic_partition.history_partition_num`: 指定创建历史分区的数量。
         * `dynamic_partition.reserved_history_periods`: 用于指定保留的历史分区的时间段。
-    
-    * 数据排序相关
-    
-        数据排序相关参数如下:
-    
-        * `data_sort.sort_type`: 数据排序使用的方法,目前支持两种:lexical/z-order,默认是lexical
-        * `data_sort.col_num`: 数据排序使用的列数,取最前面几列,不能超过总的key 列数
+
 ### Example
 
 1. 创建一个明细模型的表
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java 
b/fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java
index 137630b516..155cad1707 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java
@@ -756,18 +756,10 @@ public class PropertyAnalyzer {
             sortMethod = properties.remove(DataSortInfo.DATA_SORT_TYPE);
         }
         TSortType sortType = TSortType.LEXICAL;
-        if (sortMethod.equalsIgnoreCase(TSortType.ZORDER.name())) {
-            sortType = TSortType.ZORDER;
-        } else if (sortMethod.equalsIgnoreCase(TSortType.LEXICAL.name())) {
+        if (sortMethod.equalsIgnoreCase(TSortType.LEXICAL.name())) {
             sortType = TSortType.LEXICAL;
         } else {
-            throw new AnalysisException("only support zorder/lexical method!");
-        }
-        if (keyType != KeysType.DUP_KEYS && sortType == TSortType.ZORDER) {
-            throw new AnalysisException("only duplicate key supports zorder 
method!");
-        }
-        if (storageFormat != TStorageFormat.V2 && sortType == 
TSortType.ZORDER) {
-            throw new AnalysisException("only V2 storage format supports 
zorder method!");
+            throw new AnalysisException("only support lexical method now!");
         }
 
         int colNum = keyCount;
@@ -778,9 +770,6 @@ public class PropertyAnalyzer {
                 throw new AnalysisException("param " + 
DataSortInfo.DATA_SORT_COL_NUM + " error");
             }
         }
-        if (sortType == TSortType.ZORDER && (colNum <= 1 || colNum > 
keyCount)) {
-            throw new AnalysisException("z-order needs 2 columns at least, " + 
keyCount + " columns at most!");
-        }
         DataSortInfo dataSortInfo = new DataSortInfo(sortType, colNum);
         return dataSortInfo;
     }
diff --git 
a/fe/fe-core/src/test/java/org/apache/doris/catalog/CreateTableTest.java 
b/fe/fe-core/src/test/java/org/apache/doris/catalog/CreateTableTest.java
index 6182036784..d86a4e88b6 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/catalog/CreateTableTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/catalog/CreateTableTest.java
@@ -571,22 +571,26 @@ public class CreateTableTest {
                         + " 'data_sort.sort_type' = 'lexical');"));
 
         // create z-order sort table, default col_num
-        ExceptionChecker.expectThrowsNoException(() -> createTable(
-                "create table test.zorder_tbl2\n" + "(k1 varchar(40), k2 int, 
k3 int)\n" + "duplicate key(k1, k2, k3)\n"
-                        + "partition by range(k2)\n" + "(partition p1 values 
less than(\"10\"))\n"
-                        + "distributed by hash(k1) buckets 1\n" + 
"properties('replication_num' = '1',"
-                        + " 'data_sort.sort_type' = 'zorder');"));
+        ExceptionChecker
+                .expectThrowsWithMsg(AnalysisException.class, "only support 
lexical method now!",
+                        ()  -> createTable(
+                                "create table test.zorder_tbl2\n" + "(k1 
varchar(40), k2 int, k3 int)\n" + "duplicate key(k1, k2, k3)\n"
+                                + "partition by range(k2)\n" + "(partition p1 
values less than(\"10\"))\n"
+                                + "distributed by hash(k1) buckets 1\n" + 
"properties('replication_num' = '1',"
+                                + " 'data_sort.sort_type' = 'zorder');"));
 
         // create z-order sort table, define sort_col_num
-        ExceptionChecker.expectThrowsNoException(() -> createTable(
-                "create table test.zorder_tbl3\n" + "(k1 varchar(40), k2 int, 
k3 int)\n" + "duplicate key(k1, k2, k3)\n"
-                        + "partition by range(k2)\n" + "(partition p1 values 
less than(\"10\"))\n"
-                        + "distributed by hash(k1) buckets 1\n" + 
"properties('replication_num' = '1',"
-                        + " 'data_sort.sort_type' = 'zorder',"
-                        + " 'data_sort.col_num' = '2');"));
+        ExceptionChecker
+                .expectThrowsWithMsg(AnalysisException.class, "only support 
lexical method now!",
+                        ()  -> createTable(
+                                "create table test.zorder_tbl3\n" + "(k1 
varchar(40), k2 int, k3 int)\n" + "duplicate key(k1, k2, k3)\n"
+                                + "partition by range(k2)\n" + "(partition p1 
values less than(\"10\"))\n"
+                                + "distributed by hash(k1) buckets 1\n" + 
"properties('replication_num' = '1',"
+                                + " 'data_sort.sort_type' = 'zorder',"
+                                + " 'data_sort.col_num' = '2');"));
         // create z-order sort table, only 1 sort column
         ExceptionChecker
-                .expectThrowsWithMsg(AnalysisException.class, "z-order needs 2 
columns at least, 3 columns at most",
+                .expectThrowsWithMsg(AnalysisException.class, "only support 
lexical method now!",
                         () -> createTable("create table test.zorder_tbl4\n" + 
"(k1 varchar(40), k2 int, k3 int)\n" + "duplicate key(k1, k2, k3)\n"
                                 + "partition by range(k2)\n" + "(partition p1 
values less than(\"10\"))\n"
                                 + "distributed by hash(k1) buckets 1\n" + 
"properties('replication_num' = '1',"
@@ -594,7 +598,7 @@ public class CreateTableTest {
                                 + " 'data_sort.col_num' = '1');"));
         // create z-order sort table, sort column is empty
         ExceptionChecker
-                .expectThrowsWithMsg(AnalysisException.class, "param 
data_sort.col_num error",
+                .expectThrowsWithMsg(AnalysisException.class, "only support 
lexical method now!",
                         () -> createTable("create table test.zorder_tbl4\n" + 
"(k1 varchar(40), k2 int, k3 int)\n" + "duplicate key(k1, k2, k3)\n"
                                 + "partition by range(k2)\n" + "(partition p1 
values less than(\"10\"))\n"
                                 + "distributed by hash(k1) buckets 1\n" + 
"properties('replication_num' = '1',"


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

Reply via email to