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


##########
fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java:
##########
@@ -605,6 +605,9 @@ public void queryRetry(TUniqueId queryId) throws Exception {
         }
         for (int i = 1; i <= retryTime; i++) {
             try {
+                if (i > 1) {
+                    
statementContext.resetMaterializedViewStateForPlanningAttempt();

Review Comment:
   **[P1] Reset the StatementContext created by proxy parsing**
   
   A forwarded statement reaches this ownership split:
   
   ```text
   proxy constructor: executor=A, connection=A
   lazy parse:        executor=A, connection=B
   E-230 retry:       reset A, replan using B
   ```
   
   `visitMultiStatements` installs adapter context B in `ConnectContext`, while 
the executor field remains A. MV hint extraction/lookup and proxy command 
planning use connection context B. On retry this line clears A, so re-analyzing 
the unchanged `USE_MV`/`NO_USE_MV` hint appends another copy to B, marks both 
copies as syntax errors, and silently ignores the directive. Proxy INSERTs 
retain the rest of B's MV attempt state for the same reason. Please synchronize 
the executor to the parsed adapter context (or reset the authoritative 
connection context) before planning/retrying, and add a proxy-style real-parse 
retry test.



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