morrySnow commented on code in PR #20270: URL: https://github.com/apache/doris/pull/20270#discussion_r1220739906
########## fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java: ########## @@ -239,6 +239,8 @@ public class SessionVariable implements Serializable, Writable { public static final String ENABLE_DPHYP_TRACE = "enable_dphyp_trace"; + public static final String ENABLE_FOLD_UNFIXED_FN = "enable_fold_unfixed_fn"; Review Comment: UNFIXED --> Nondeterministic ########## fe/fe-core/src/main/java/org/apache/doris/analysis/ExpressionFunctions.java: ########## @@ -67,6 +77,12 @@ public Expr evalExpr(Expr constExpr) { || constExpr instanceof FunctionCallExpr || constExpr instanceof TimestampArithmeticExpr) { Function fn = constExpr.getFn(); + if (ConnectContext.get() != null + && ConnectContext.get().getSessionVariable() != null + && !ConnectContext.get().getSessionVariable().isEnableFoldUnfixedFn() + && unfixedFn.contains(fn.getFunctionName().getFunction())) { Review Comment: ```suggestion if ((ConnectContext.get() == null || ConnectContext.get().getSessionVariable() == null || ConnectContext.get().getSessionVariable().isEnableFoldUnfixedFn()) && unfixedFn.contains(fn.getFunctionName().getFunction())) { ``` -- 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