Jackie-Jiang commented on a change in pull request #8382:
URL: https://github.com/apache/pinot/pull/8382#discussion_r832657301
##########
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:
The annotation parsing logic can be moved to `FunctionRegistry`, and the
nullable info can be stored in `FunctionInfo`
##########
File path:
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/DateTimeFunctions.java
##########
@@ -247,7 +247,7 @@ public static Timestamp toTimestamp(long millis) {
/**
* Converts Timestamp to epoch millis
*/
- @ScalarFunction
Review comment:
Why are they annotated as nullable? The input should not be null
--
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]