Sh-Zh-7 commented on code in PR #15151:
URL: https://github.com/apache/iotdb/pull/15151#discussion_r2086423002


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/ExpressionAnalyzer.java:
##########
@@ -798,16 +887,41 @@ protected Type visitFunctionCall(
       }
 
       Type type = metadata.getFunctionReturnType(functionName, argumentTypes);
+      FunctionKind functionKind = FunctionKind.SCALAR;
+      if (isAggregation) {
+        functionKind = FunctionKind.AGGREGATE;
+      } else {
+        boolean isWindow = metadata.isWindowFunction(session, functionName, 
accessControl);
+        if (isWindow) {
+          functionKind = FunctionKind.WINDOW;
+        }
+      }
+      FunctionNullability functionNullability = null;
+      switch (functionKind) {
+        case AGGREGATE:
+          functionNullability =
+              
FunctionNullability.getAggregationFunctionNullability(argumentTypes.size());
+          break;
+        case SCALAR:
+          functionNullability =
+              
FunctionNullability.getScalarFunctionNullability(argumentTypes.size());
+          break;
+        case WINDOW:
+          functionNullability =
+              
FunctionNullability.getWindowFunctionNullability(argumentTypes.size());
+          break;
+        default:
+          // ignore
+      }
+
       // now we only support scalar or agg functions

Review Comment:
   Deleted.



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

Reply via email to