morrySnow commented on code in PR #68269:
URL: https://github.com/apache/doris/pull/68269#discussion_r4080751983
##########
fe/fe-core/src/main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java:
##########
@@ -969,10 +970,11 @@ private IvmPlanSignature refreshPartitions(Set<String>
refreshPartitionNames,
Map<TableIf, String> tableWithPartKey,
Optional<IvmRewriteContext> rewriteContext, RefreshMode
refreshMode)
throws Exception {
- // Create MTMV context first so that new StatementContext() captures
the
- // correct thread-local ConnectContext (with MTMV disabled rules,
etc.).
+ // Create the MTMV context before parsing the MV definition SQL so
SET_VAR hints
+ // resolve against the internal session (with MTMV disabled rules,
etc.).
ConnectContext mtmvCtx = MTMVPlanUtil.createMTMVContext(mtmv,
MTMVPlanUtil.DISABLE_RULES_WHEN_RUN_MTMV_TASK);
- StatementContext statementContext = new StatementContext();
+ StatementContext statementContext = new StatementContext(
+ mtmvCtx, new OriginStatement(mtmv.getQuerySql(), 0));
Review Comment:
Fixed in 7cb38cef96b. Incremental refresh and incremental dry run now
install their origin-bearing `StatementContext` on the internal
`ConnectContext` before parsing the MV query, so `SET_VAR` hint parsing sees
the correct context. I added focused FE tests for both paths and updated the
dry-run regression case to use a hinted MV query. All 181 related FE unit tests
and Checkstyle passed; the regression suite was updated but not run locally.
--
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]