richardstartin commented on a change in pull request #8382:
URL: https://github.com/apache/pinot/pull/8382#discussion_r832654127



##########
File path: 
pinot-common/src/main/java/org/apache/pinot/common/function/FunctionInvoker.java
##########
@@ -131,4 +133,19 @@ public Object invoke(Object[] arguments) {
           "Caught exception while invoking method: " + _method + " with 
arguments: " + Arrays.toString(arguments), e);
     }
   }
+
+  /**
+   * Whether method is a scalar function with nullableParameters property set 
to true.
+   */
+  public boolean hasNullableParameters() {
+    for (final Annotation annotation : _method.getAnnotations()) {
+      if (annotation.annotationType().equals(ScalarFunction.class)) {
+        final ScalarFunction scalarFunctionAnnotation = (ScalarFunction) 
annotation;
+        if (scalarFunctionAnnotation.nullableParameters()) {
+          return true;
+        }
+      }
+    }
+    return false;

Review comment:
       or even replace `isAnnotationPresent` with a null check on the result of 
`getAnnotation` and if not null check if there are nullable parameters or not 
if you want to speed it up.




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

Reply via email to