yujun777 commented on code in PR #68648:
URL: https://github.com/apache/doris/pull/68648#discussion_r4237040181


##########
fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRelatedPartitionDescTransferGenerator.java:
##########
@@ -46,17 +46,27 @@ public class MTMVRelatedPartitionDescTransferGenerator 
implements MTMVRelatedPar
     public void apply(MTMVPartitionInfo mvPartitionInfo, Map<String, String> 
mvProperties,
             RelatedPartitionDescResult lastResult, List<Column> 
partitionColumns,
                       Map<List<String>, Set<String>> queryUsedPartitionMap) 
throws AnalysisException {
-        Map<MTMVRelatedTableIf, Map<PartitionKeyDesc, Set<String>>> descs = 
lastResult.getDescs();
+        Map<PartitionKeyDesc, Map<MTMVRelatedTableIf, Set<String>>> merged =

Review Comment:
   Fixed in 905d45d79db, along your first line: the partitions to union stay 
with the table the compensation pair names. They were merged into one set and 
put on every table, which is right only while a name means the same keys in 
each of them -- and the cross-table LIST merge this PR adds is exactly what 
makes a two-table MV buildable whose tables reuse names for different keys. 
Merged, the base branch also read A.p1 and B.p3, whose keys the MV's own branch 
supplies, and the `UNION ALL` counted them twice. `PredicateAdder` consumes the 
pair per table, so nothing else changes.
   
   On the regression you ask for: I built the shape -- `LIST(d, k)` A.p1={1,2}, 
A.p2={3}, A.p3={4} beside B.p1={4}, B.p2={2,3}, B.p3={1}, an MV partitioned by 
d whose partitions came out as `p_1_2_3` and `p_4`, then a write under `p_4` -- 
and the compensation branch is not reached for it on this build: the query is 
planned from the base tables alone, the same limit the earlier compensation 
threads record (`checkMaterializationPattern` refuses a partly usable MV here). 
So a case for it would assert a path it does not exercise, and I have not added 
one; what the change is verified against is that the compensation the suites do 
exercise is unchanged (`partition_mv_rewrite`, `union_rewrite_grace_big`, and 
the `mtmv_p0` set: all pass). The fixture above is what to reach the path with 
where it can be reached.
   



-- 
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