Skip to content

Commit

Permalink
fold maybe need rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangstar333 committed Dec 15, 2023
1 parent b380676 commit 1d24227
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1120,17 +1120,18 @@ private void analyzeAndGenerateQueryPlan(TQueryOptions tQueryOptions) throws Use
}
ExprRewriter rewriter = analyzer.getExprRewriter();
rewriter.reset();
if (context.getSessionVariable().isEnableFoldConstantByBe()) {
// fold constant expr
parsedStmt.foldConstant(rewriter, tQueryOptions);

}
// Apply expr and subquery rewrites.
ExplainOptions explainOptions = parsedStmt.getExplainOptions();
boolean reAnalyze = false;

parsedStmt.rewriteExprs(rewriter);
reAnalyze = rewriter.changed();
if (context.getSessionVariable().isEnableFoldConstantByBe()) {
// fold constant expr
parsedStmt.foldConstant(rewriter, tQueryOptions);

}
if (analyzer.containSubquery()) {
parsedStmt = setParsedStmt(StmtRewriter.rewrite(analyzer, parsedStmt));
reAnalyze = true;
Expand Down

0 comments on commit 1d24227

Please sign in to comment.