// It's OK for the description to be null.
//final String description = udf.getDescription();
final Type[] parameterTypes = udf.getParameterTypes();
for (int i = 0; i < parameterTypes.length; i++) {
Type parameterType = parameterTypes[i];
if (parameterType == null) {
throw Util.newInternal(
"Invalid user-defined function '" + udfName
+ "': parameter type #" + i + " is null");
}
}
// It's OK for the reserved words to be null or empty.
//final String[] reservedWords = udf.getReservedWords();
// Test that the function returns a sensible type when given the FORMAL
// types. It may still fail when we give it the ACTUAL types, but it's
// impossible to check that now.
final Type returnType = udf.getReturnType(parameterTypes);
if (returnType == null) {
throw Util.newInternal(
"Invalid user-defined function '" + udfName
+ "': return type is null");
}