Check call convention once in ExpressionInterpreter.visitFunctionCall
@@ -894,12 +894,14 @@ public class ExpressionInterpreter
}
FunctionHandle functionHandle = metadata.getFunctionManager().resolveFunction(session, node.getName(), fromTypes(argumentTypes));
FunctionMetadata functionMetadata = metadata.getFunctionManager().getFunctionMetadata(functionHandle);
+ if (!functionMetadata.isCalledOnNullInput()) {
for (int i = 0; i < argumentValues.size(); i++) {
Object value = argumentValues.get(i);
- if (value == null && !functionMetadata.isCalledOnNullInput()) {
+ if (value == null) {
return null;
}
}
+ }
// do not optimize non-deterministic functions
if (optimize && (!functionMetadata.isDeterministic() || hasUnresolvedValue(argumentValues) || node.getName().equals(QualifiedName.of("fail")))) {
