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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/executor/Rewriter.java:
##########
@@ -728,6 +727,9 @@ public class Rewriter extends AbstractBatchJobExecutor {
                                 new 
LogicalResultSinkToShortCircuitPointQuery(),
                                 new PruneOlapScanPartition(),
                                 new PruneEmptyPartition(),
+                                // Stream lowering needs the pruned partitions 
and must finish before
+                                // OperativeColumnDerive treats stream virtual 
columns as scan slots.
+                                new NormalizeOlapTableStreamScan(),

Review Comment:
   The temp plan recorded for pre-MV rewrite still uses 
`CTE_CHILDREN_REWRITE_JOBS_MV_REWRITE_USED`, and that private Table/Physical 
batch does not include `NormalizeOlapTableStreamScan`. Since 
`RecordPlanForMvPreRewrite` runs before this new normalization batch, any 
stream scan in the recorded plan remains a `LogicalOlapTableStreamScan`. During 
`preMaterializedViewRewrite` that temp plan is optimized independently, and 
`logicalOlapScan()` matches subclasses, so the stream wrapper can be 
implemented as a normal `PhysicalOlapScan` instead of being lowered to the 
intended base/binlog/reset/snapshot plan. This is a regression from the old 
placement, which normalized before recording. Please include the 
stream-normalization rule in the MV pre-rewrite job list, or record after 
stream lowering, and cover a stream query that triggers pre-MV rewrite.



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