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

kxiao 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 ecabbcd63c2 [chore](table property) forbid changing 
enable_single_replica_compaction property for mow table (#34836)
ecabbcd63c2 is described below

commit ecabbcd63c206150b87f4875c01668cdbb01be33
Author: Sun Chenyang <[email protected]>
AuthorDate: Sun May 26 15:32:20 2024 +0800

    [chore](table property) forbid changing enable_single_replica_compaction 
property for mow table (#34836)
---
 .../apache/doris/alter/SchemaChangeHandler.java    |  5 +++++
 .../test_table_level_compaction_policy.groovy      | 24 ++++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java 
b/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java
index 4880b82221b..4a6fc3fd856 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java
@@ -2292,6 +2292,11 @@ public class SchemaChangeHandler extends AlterHandler {
             enableSingleCompaction = Boolean.parseBoolean(singleCompaction) ? 
1 : 0;
         }
 
+        if (enableUniqueKeyMergeOnWrite && 
Boolean.parseBoolean(singleCompaction)) {
+            throw new UserException(
+                    "enable_single_replica_compaction property is not 
supported for merge-on-write table");
+        }
+
         String disableAutoCompactionBoolean = 
properties.get(PropertyAnalyzer.PROPERTIES_DISABLE_AUTO_COMPACTION);
         int disableAutoCompaction = -1; // < 0 means don't update
         if (disableAutoCompactionBoolean != null) {
diff --git 
a/regression-test/suites/compaction/test_table_level_compaction_policy.groovy 
b/regression-test/suites/compaction/test_table_level_compaction_policy.groovy
index e0b606af9d1..2ff9b1f7fea 100644
--- 
a/regression-test/suites/compaction/test_table_level_compaction_policy.groovy
+++ 
b/regression-test/suites/compaction/test_table_level_compaction_policy.groovy
@@ -242,4 +242,28 @@ suite("test_table_level_compaction_policy") {
     }
     sql """ DROP TABLE IF EXISTS ${tableName} """
     sql """sync"""
+
+    sql """
+        CREATE TABLE ${tableName} (
+                `c_custkey` int(11) NOT NULL COMMENT "",
+                `c_name` varchar(26) NOT NULL COMMENT "",
+                `c_address` varchar(41) NOT NULL COMMENT "",
+                `c_city` varchar(11) NOT NULL COMMENT ""
+        )
+        UNIQUE KEY (`c_custkey`)
+        DISTRIBUTED BY HASH(`c_custkey`) BUCKETS 1
+        PROPERTIES (
+                "replication_num" = "1"
+            );
+    """
+    sql """sync"""
+
+    test {
+        sql """
+            alter table  ${tableName} set ("enable_single_replica_compaction" 
= "true")
+            """
+        exception "enable_single_replica_compaction property is not supported 
for merge-on-write table"
+    }
+    sql """ DROP TABLE IF EXISTS ${tableName} """
+    sql """sync"""
 }


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

Reply via email to