924060929 commented on code in PR #66473:
URL: https://github.com/apache/doris/pull/66473#discussion_r3782127772
##########
fe/fe-core/src/main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java:
##########
@@ -202,6 +203,7 @@ public void run() throws JobException {
Pair<Set<TableIf>, Set<TableIf>> tablesInPlan =
MTMVPlanUtil.getBaseTableFromQuery(mtmv.getQuerySql(), ctx);
this.relation =
MTMVPlanUtil.generateMTMVRelation(tablesInPlan.first, tablesInPlan.second);
beforeMTMVRefresh();
+ installTaskSnapshots(ctx.getStatementContext());
Review Comment:
Fixed in 44a3365fd2a. The finding was correct: createMTMVContext leaves
statementContext null, while getBaseTableFromQuery only installs a temporary
context and restores that null value. MTMVTask now creates and attaches its
task-level StatementContext immediately after createMTMVContext and before
analysis or snapshot capture, so installTaskSnapshots always receives the
context that remains active between refresh chunks. The new
TaskProcessorTest.testCreateMTMVTaskContextInstallsStatementContext invokes the
real MTMVPlanUtil.createMTMVContext initialization path through MTMVTask rather
than manually pre-populating a context. Together with the two-chunk snapshot
test, TaskProcessorTest passes 6/6 after a full fe-core recompilation. The
identical path was also fixed on master.
--
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]