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

dataroaring pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new ba51637533b [fix](create table) fix nereids create table no check 
buckets=0 #38971 (#39000)
ba51637533b is described below

commit ba51637533b7730b7979b21de82bf461e07e8c03
Author: yujun <yu.jun.re...@gmail.com>
AuthorDate: Wed Aug 7 16:56:09 2024 +0800

    [fix](create table) fix nereids create table no check buckets=0 #38971 
(#39000)
    
    cherry pick from #38971
---
 .../suites/table_p0/test_table_with_buckets.groovy | 53 ++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/regression-test/suites/table_p0/test_table_with_buckets.groovy 
b/regression-test/suites/table_p0/test_table_with_buckets.groovy
new file mode 100644
index 00000000000..42917093b41
--- /dev/null
+++ b/regression-test/suites/table_p0/test_table_with_buckets.groovy
@@ -0,0 +1,53 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite('test_table_with_buckets') {
+    def tbl1 = 'test_table_with_buckets_tbl1'
+    def tbl2 = 'test_table_with_buckets_tbl2'
+    sql "drop table if exists `${tbl1}`"
+    sql "drop table if exists `${tbl2}`"
+    try {
+        test {
+            sql "create table ${tbl1}(k int) distributed by hash(k) buckets 0 
properties('replication_num' = '1')"
+            exception 'Number of hash distribution should be greater than 
zero.'
+        }
+
+        test {
+            sql """
+                CREATE TABLE IF NOT EXISTS ${tbl2} ( k1 date NOT NULL, k2 
varchar(20) NOT NULL, k3 int sum NOT NULL )
+                AGGREGATE KEY(k1,k2)
+                PARTITION BY RANGE(k1) ( )
+                DISTRIBUTED BY HASH(k1) BUCKETS 3
+                PROPERTIES (
+                    "dynamic_partition.enable"="true",
+                    "dynamic_partition.end"="3",
+                    "dynamic_partition.buckets"="0",
+                    "dynamic_partition.start"="-3",
+                    "dynamic_partition.prefix"="p",
+                    "dynamic_partition.time_unit"="DAY",
+                    "dynamic_partition.create_history_partition"="true",
+                    "dynamic_partition.replication_allocation" = 
"tag.location.default: 1"
+                )
+            """
+
+            exception 'Dynamic partition buckets must greater than 0'
+        }
+    } finally {
+        sql "drop table if exists `${tbl1}`"
+        sql "drop table if exists `${tbl2}`"
+    }
+}


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

Reply via email to