vlsi commented on code in PR #5213:
URL: https://github.com/apache/calcite/pull/5213#discussion_r4265860789
##########
linq4j/src/main/java/org/apache/calcite/linq4j/tree/FunctionExpression.java:
##########
@@ -104,7 +104,8 @@ public F getFunction() {
dynamicFunction =
(F) Proxy.newProxyInstance(classLoader,
new Class[]{Types.toClass(type)},
- (proxy, method, args) -> x.dynamicInvoke(args));
+ (proxy, method, args) ->
+ x.dynamicInvoke(args == null ? new Object[0] : args));
Review Comment:
```
java.lang.NullPointerException: Cannot read the array length because "args"
is null
at
org.apache.calcite.linq4j.tree.FunctionExpression.lambda$compile$0(FunctionExpression.java:88)
at
org.apache.calcite.linq4j.tree.FunctionExpression.lambda$getFunction$0(FunctionExpression.java:108)
```
An alternative option would be handling null `args` in `compile()`
--
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]