Open martint opened 4 years ago
Should we add a check in FunctionRegistry.class to improve the error message like this?
checkArgument(!functionMetadata.getSignature().getArgumentTypes().contains(new TypeSignature("int")),
"Function arguments should use a canonical name integer of int", functionMetadata.getSignature());
@yuokada ideally we would try to determine something is an alias in a generic manner (types can be provided by plugins too).
Given this function:
SELECT test(1)
fails with:The query succeeds if the canonical name for the
integer
type is used in the function argument declaration:@SqlType("integer")
Ideally, this should work for both type synonyms, but at a minimum, we should improve the error message.