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: [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]