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 2023/04/06 07:32:27 UTC

[doris] 02/09: [fix](catalog) all properties should be checked when create unpartitioned table (#18149)

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

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

commit 335b8d1832ee1bb0584f1bb5788f593bfb34d450
Author: xueweizhang <zx...@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 <zx...@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 +-
 4 files changed, 10 insertions(+), 2 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 7bd96078b2..499054815f 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
@@ -2093,6 +2093,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 93c8cd7181..6e38c4dbf1 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 f2085315ef..42179fbd5e 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
@@ -2048,7 +2048,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"
 );
 


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