You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "morrySnow (via GitHub)" <gi...@apache.org> on 2023/06/07 02:47:09 UTC

[GitHub] [doris] morrySnow commented on a diff in pull request #20270: [Enhancement](planner)add switch to determine if some unfixed functions will be folded on fe.

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-unsubscribe@doris.apache.org

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


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