HappenLee commented on code in PR #66734:
URL: https://github.com/apache/doris/pull/66734#discussion_r3777653605
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/FoldConstantRuleOnFE.java:
##########
@@ -121,22 +121,35 @@ public class FoldConstantRuleOnFE extends
AbstractExpressionRewriteRule
public static final FoldConstantRuleOnFE VISITOR_INSTANCE = new
FoldConstantRuleOnFE(true);
public static final FoldConstantRuleOnFE PATTERN_MATCH_INSTANCE = new
FoldConstantRuleOnFE(false);
+ private static final FoldConstantRuleOnFE CONTEXT_FREE_VISITOR_INSTANCE
+ = new FoldConstantRuleOnFE(true, false);
// record whether current expression is in an aggregate function with
distinct,
// if is, we will skip to fold constant
private static final ListenAggDistinct LISTEN_AGG_DISTINCT = new
ListenAggDistinct();
private static final CheckWhetherUnderAggDistinct NOT_UNDER_AGG_DISTINCT =
new CheckWhetherUnderAggDistinct();
private final boolean deepRewrite;
+ private final boolean foldContextDependentExpressions;
public FoldConstantRuleOnFE(boolean deepRewrite) {
+ this(deepRewrite, true);
+ }
+
+ private FoldConstantRuleOnFE(boolean deepRewrite, boolean
foldContextDependentExpressions) {
this.deepRewrite = deepRewrite;
+ this.foldContextDependentExpressions = foldContextDependentExpressions;
}
public static Expression evaluate(Expression expression,
ExpressionRewriteContext expressionRewriteContext) {
return VISITOR_INSTANCE.rewrite(expression, expressionRewriteContext);
}
+ /** Evaluate expressions that do not require a rewrite or connection
context. */
+ public static Expression evaluateWithoutContext(Expression expression) {
Review Comment:
conner case
--
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]