seawinde commented on code in PR #44960:
URL: https://github.com/apache/doris/pull/44960#discussion_r1869364684


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/properties/SelectHintSetVar.java:
##########
@@ -50,6 +50,9 @@ public Map<String, Optional<String>> getParameters() {
      * @param context statement context
      */
     public void setVarOnceInSql(StatementContext context) {
+        if (context == null) {

Review Comment:
   I think the root cause maybe is the code in 
org.apache.doris.mtmv.MTMVCache#from
   
   the code as following
   ```
           StatementContext mvSqlStatementContext = new 
StatementContext(connectContext,
                   new OriginStatement(mtmv.getQuerySql(), 0));
           NereidsPlanner planner = new NereidsPlanner(mvSqlStatementContext);
           if (mvSqlStatementContext.getConnectContext().getStatementContext() 
== null) {
               
mvSqlStatementContext.getConnectContext().setStatementContext(mvSqlStatementContext);
           }
   ```
   
   should before` LogicalPlan unboundMvPlan = new 
NereidsParser().parseSingle(mtmv.getQuerySql())`;
   
   then the StatementContext is not null in current connect Context



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to