github-actions[bot] commented on code in PR #69168:
URL: https://github.com/apache/doris/pull/69168#discussion_r4291597892


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateMTMVInfo.java:
##########
@@ -446,13 +459,17 @@ private void setTableInformation(ConnectContext ctx) {
         this.setTableName(tableNameInfo.getTbl());
         this.setCtasColumns(ctasColumns.isEmpty() ? null : ctasColumns);
         this.setEngineName(CreateTableInfo.ENGINE_OLAP);
-        if (isEnableIvm()) {
+        if (isEnableIvm() && !ivmAppendOnlyDupModel) {
+            // The unique-key model merges on write, which is what its row-id, 
delete sign and sequence
+            // column are for.
             this.setKeysType(KeysType.UNIQUE_KEYS);
             if (properties == null) {
                 properties = Maps.newHashMap();
             }
             properties.put(PropertyAnalyzer.ENABLE_UNIQUE_KEY_MERGE_ON_WRITE, 
"true");
         } else {
+            // A non-IVM MV and an append-only detail MV are both plain DUP 
tables: the detail one holds the
+            // query's own rows and only appends them, so there is nothing for 
merge-on-write to do.
             this.setKeysType(KeysType.DUP_KEYS);

Review Comment:
   [P2] Use DUP partition validation for detail IVM views
   
   For a row-binlog DUP source partitioned on `dt`, an MV declared with 
`KEY(id) PARTITION BY(dt) ... AS SELECT id, dt, v FROM t` now selects this 
plain-DUP branch and keeps `dt` outside its key prefix. But 
`validatePartitionInfo()` below still sets `validateAsMow = isEnableIvm() || 
isEnableMergeOnWrite()`, so `PartitionTableInfo.validatePartitionColumn()` 
rejects it with `Merge-on-Write table's partition column must be KEY column`. 
This is a legal DUP layout (also reachable with inferred keys when an earlier 
VARCHAR ends the key prefix), yet the new model cannot be created. Derive the 
partition-validation flag from the chosen physical MOW model and cover a 
partitioned detail MV whose partition column is a value column.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to