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


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/MTMV.java:
##########
@@ -1697,9 +1714,16 @@ public Map<String, Map<MTMVRelatedTableIf, Set<String>>> 
calculatePartitionMappi
         Map<PartitionKeyDesc, Map<MTMVRelatedTableIf, Set<String>>> 
pctPartitionDescs = MTMVPartitionUtil
                 .generateRelatedPartitionDescs(mvPartitionInfo, mvProperties, 
getPartitionColumns(),

Review Comment:
   这里会调用 generateRelatedPartitionDescs() 计算每个 MV 分区对应哪些基表分区。其中按月归并 RANGE 
分区时,会调用 MTMVPartitionExprDateTrunc.dateTrunc(..., true) 
判断上界所属月份,内部会先减一秒,再检查首尾是否属于同一个月
   
   如果基表分区是 [2024-01-01 00:00:00.123, 2024-02-01 
00:00:00.123),实际包含二月的数据,但上界**减一秒**后退回一月,跨月校验就误通过了,整个分区只关联一月 MV。
   
   本 PR 再按这份映射限制读取,一月 MV 会过滤掉其中的二月数据,二月 MV 
又不会读这个基表分区,最终会漏行。需要先修正跨月校验,再把映射作为完整的读取范围。



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