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

[GitHub] [doris] BiteTheDDDDt commented on a diff in pull request #20282: [refactor-WIP](functions) Check ReturnType of functions on FE

BiteTheDDDDt commented on code in PR #20282:
URL: https://github.com/apache/doris/pull/20282#discussion_r1212813170


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java:
##########
@@ -2047,15 +2053,29 @@ protected boolean isConstantImpl() {
         }
 
         final String fnName = this.fnName.getFunction();
+
+        if (isConstantForSpecialCases(fnName)) {
+            return true;
+        }
         // Non-deterministic functions are never constant.
         if (isNondeterministicBuiltinFnName(fnName)) {
             return false;
         }
-        // Sleep is a special function for testing.
+        // specially decide some functions.
         if (fnName.equalsIgnoreCase("sleep")) {
             return false;
         }
-        return super.isConstantImpl();
+
+        return super.isConstantImpl(); // True as default.
+    }
+
+    private boolean isConstantForSpecialCases(String fnName) {
+        if (fnName.equalsIgnoreCase("is_null_pred") || fnName.equalsIgnoreCase("is_not_null_pred")) {

Review Comment:
   is_null_pred's is_constant depending on argument column's is_nullable.



-- 
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