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

morningman pushed a commit to branch doris-for-zhongjin
in repository https://gitbox.apache.org/repos/asf/doris.git

commit f38316fce0ed44046bfa0108d053902db27ea707
Author: xueweizhang <zxw520bl...@163.com>
AuthorDate: Tue Apr 4 08:53:45 2023 +0800

    [fix](catalog) all properties should be checked when create unpartitioned 
table (#18149)
    
    all properties should be checked when create unpartitioned table like 
partitioned table.
    
    
    
    Signed-off-by: nextdreamblue <zxw520bl...@163.com>
---
 .../src/main/java/org/apache/doris/datasource/InternalCatalog.java   | 4 ++++
 .../src/test/java/org/apache/doris/catalog/CreateTableTest.java      | 5 +++++
 fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java | 1 -
 regression-test/suites/delete_p0/test_delete_sign_mow.sql            | 2 +-
 regression-test/suites/dynamic_table_p0/load.groovy                  | 2 +-
 regression-test/suites/inverted_index_p0/test_array_index.groovy     | 3 +--
 regression-test/suites/nereids_p0/test_delete_sign_mow.sql           | 2 +-
 7 files changed, 13 insertions(+), 6 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java 
b/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java
index e2be6ff0a7..1db65add8f 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java
@@ -2175,6 +2175,10 @@ public class InternalCatalog implements 
CatalogIf<Database> {
         // create partition
         try {
             if (partitionInfo.getType() == PartitionType.UNPARTITIONED) {
+                if (storagePolicy.equals("") && properties != null && 
!properties.isEmpty()) {
+                    // here, all properties should be checked
+                    throw new DdlException("Unknown properties: " + 
properties);
+                }
                 // this is a 1-level partitioned table
                 // use table name as partition name
                 DistributionInfo partitionDistributionInfo = 
distributionDesc.toDistributionInfo(baseSchema);
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 39817e2fcd..6182036784 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
@@ -243,6 +243,11 @@ public class CreateTableTest {
 
     @Test
     public void testAbnormal() throws DdlException, ConfigException {
+        ExceptionChecker.expectThrowsWithMsg(DdlException.class,
+                "Unknown properties: {aa=bb}",
+                () -> createTable("create table test.atbl1\n" + "(k1 int, k2 
float)\n" + "duplicate key(k1)\n"
+                        + "distributed by hash(k1) buckets 1\n" + 
"properties('replication_num' = '1','aa'='bb'); "));
+
         ExceptionChecker.expectThrowsWithMsg(DdlException.class,
                 "Floating point type should not be used in distribution 
column",
                 () -> createTable("create table test.atbl1\n" + "(k1 int, k2 
float)\n" + "duplicate key(k1)\n"
diff --git 
a/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java 
b/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
index a057325d10..01b2bfff5f 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
@@ -2031,7 +2031,6 @@ public class QueryPlanTest extends TestWithFeService {
                 + "PROPERTIES (\n"
                 + "\"replication_num\" = \"1\",\n"
                 + "\"in_memory\" = \"false\",\n"
-                + "\"business_key_column_name\" = \"\",\n"
                 + "\"storage_medium\" = \"HDD\",\n"
                 + "\"storage_format\" = \"V2\"\n"
                 + ");\n");
diff --git a/regression-test/suites/delete_p0/test_delete_sign_mow.sql 
b/regression-test/suites/delete_p0/test_delete_sign_mow.sql
index 7a64c9001d..8f11f82521 100644
--- a/regression-test/suites/delete_p0/test_delete_sign_mow.sql
+++ b/regression-test/suites/delete_p0/test_delete_sign_mow.sql
@@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS delete_sign_test_mow (
 UNIQUE KEY(uid)
 DISTRIBUTED BY HASH(uid) BUCKETS 3
 PROPERTIES (
-    "unique_key_merge_on_write" = "true",
+    "enable_unique_key_merge_on_write" = "true",
     "replication_num" = "1"
 );
 
diff --git a/regression-test/suites/dynamic_table_p0/load.groovy 
b/regression-test/suites/dynamic_table_p0/load.groovy
index 007362df12..f4bd89aba6 100644
--- a/regression-test/suites/dynamic_table_p0/load.groovy
+++ b/regression-test/suites/dynamic_table_p0/load.groovy
@@ -86,7 +86,7 @@ suite("regression_test_dynamic_table", "dynamic_table"){
             )
             UNIQUE KEY(`id`)
             DISTRIBUTED BY HASH(`id`) BUCKETS 5 
-            properties("replication_num" = "1", "enable_merge_on_write" = 
"true");
+            properties("replication_num" = "1", 
"enable_unique_key_merge_on_write" = "true");
         """
 
         //stream load src_json
diff --git a/regression-test/suites/inverted_index_p0/test_array_index.groovy 
b/regression-test/suites/inverted_index_p0/test_array_index.groovy
index 0345a5c844..1811a44b22 100644
--- a/regression-test/suites/inverted_index_p0/test_array_index.groovy
+++ b/regression-test/suites/inverted_index_p0/test_array_index.groovy
@@ -41,8 +41,7 @@ suite("test_array_index"){
        COMMENT 'OLAP'
        DISTRIBUTED BY HASH(`id`) BUCKETS 1
        PROPERTIES(
-               "replication_allocation" = "tag.location.default: 1",
-               "persistent"="false"
+               "replication_allocation" = "tag.location.default: 1"
        );
     """
     
diff --git a/regression-test/suites/nereids_p0/test_delete_sign_mow.sql 
b/regression-test/suites/nereids_p0/test_delete_sign_mow.sql
index 7a64c9001d..8f11f82521 100644
--- a/regression-test/suites/nereids_p0/test_delete_sign_mow.sql
+++ b/regression-test/suites/nereids_p0/test_delete_sign_mow.sql
@@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS delete_sign_test_mow (
 UNIQUE KEY(uid)
 DISTRIBUTED BY HASH(uid) BUCKETS 3
 PROPERTIES (
-    "unique_key_merge_on_write" = "true",
+    "enable_unique_key_merge_on_write" = "true",
     "replication_num" = "1"
 );
 


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

Reply via email to