use of io.prestosql.spi.function.FunctionKind in project hetu-core by openlookeng.
the class FunctionResolver method returnsNullOnGivenInputTypes.
private static boolean returnsNullOnGivenInputTypes(ApplicableFunction applicableFunction, List<Type> parameterTypes) {
Signature boundSignature = applicableFunction.getBoundSignature();
FunctionKind functionKind = boundSignature.getKind();
// Window and Aggregation functions have fixed semantic where NULL values are always skipped
if (functionKind != SCALAR) {
return true;
}
for (int i = 0; i < parameterTypes.size(); i++) {
Type parameterType = parameterTypes.get(i);
if (parameterType.equals(UNKNOWN)) {
// to SQL spec. So there is a loss of precision here.
if (applicableFunction.isCalledOnNullInput()) {
return false;
}
}
}
return true;
}
Aggregations