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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/IvmFullRefreshMTMV.java:
##########
@@ -86,7 +86,12 @@ private Plan rewriteScan(LogicalOlapScan scan, 
IvmRewriteContext rewriteContext)
         Optional<Set<Long>> resetPartitionIds =
                 rewriteContext.getFullRefreshResetPartitionIds(baseTableInfo);
         StreamReadMode readMode;
-        if (resetPartitionIds.isPresent()) {
+        if (rewriteContext.isExplain() || resetPartitionIds.isPresent()) {

Review Comment:
   Keeping the error here is deliberate. EXPLAIN is plan-only and must not 
create or repair metadata, so it cannot mirror `reconcileIvmStreams()`; the two 
ways to make EXPLAIN "succeed" in this state are to fall back to an ordinary 
base scan or to pretend a stream exists, and both would print a plan that is 
not the read the refresh performs after the reconcile. The state is also worth 
surfacing rather than hiding: a missing, disabled or stale IVM stream is 
exactly what the next COMPLETE refresh will silently recreate (a replacement 
stream whose historical rows are re-read as an append), and the error names the 
stream, so EXPLAIN answers "this MV's stream needs reconciling" instead of 
showing a plausible plan. If this turns out to be noisy in practice, a better 
follow-up than falling back is an EXPLAIN-specific message pointing at the 
reconcile, not a plan built without it.
   



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