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

dataroaring 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 57e248e09b [feature-wip](unique-key-merge-on-write) check whether the 
partition column is a key column when create table for MOW table (#13490)
57e248e09b is described below

commit 57e248e09b9c929cd4a0e52e198e11ca84c928ef
Author: Xin Liao <liaoxin...@126.com>
AuthorDate: Mon Oct 24 21:16:38 2022 +0800

    [feature-wip](unique-key-merge-on-write) check whether the partition column 
is a key column when create table for MOW table (#13490)
---
 .../main/java/org/apache/doris/analysis/PartitionDesc.java    | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/PartitionDesc.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/PartitionDesc.java
index d9ffa793b2..37130c41eb 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/PartitionDesc.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/PartitionDesc.java
@@ -24,6 +24,7 @@ import org.apache.doris.catalog.PartitionType;
 import org.apache.doris.catalog.PrimitiveType;
 import org.apache.doris.common.AnalysisException;
 import org.apache.doris.common.DdlException;
+import org.apache.doris.common.util.PropertyAnalyzer;
 import org.apache.doris.qe.ConnectContext;
 
 import com.google.common.collect.Lists;
@@ -63,6 +64,13 @@ public class PartitionDesc {
             throw new AnalysisException("No partition columns.");
         }
 
+        // `analyzeUniqueKeyMergeOnWrite` would modify `properties`, which 
will be used later,
+        // so we just clone a properties map here.
+        boolean enableUniqueKeyMergeOnWrite = false;
+        if (otherProperties != null) {
+            enableUniqueKeyMergeOnWrite =
+                
PropertyAnalyzer.analyzeUniqueKeyMergeOnWrite(Maps.newHashMap(otherProperties));
+        }
         Set<String> partColNames = 
Sets.newTreeSet(String.CASE_INSENSITIVE_ORDER);
         for (String partitionCol : partitionColNames) {
             if (!partColNames.add(partitionCol)) {
@@ -72,7 +80,8 @@ public class PartitionDesc {
             boolean found = false;
             for (ColumnDef columnDef : columnDefs) {
                 if (columnDef.getName().equals(partitionCol)) {
-                    if (!columnDef.isKey() && columnDef.getAggregateType() != 
AggregateType.NONE) {
+                    if (!columnDef.isKey() && (columnDef.getAggregateType() != 
AggregateType.NONE
+                            || enableUniqueKeyMergeOnWrite)) {
                         throw new AnalysisException("The partition column 
could not be aggregated column");
                     }
                     if (columnDef.getType().isFloatingPointType()) {


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

Reply via email to