@Override
public RowExpression visitCall(CallExpression call, final Void context)
{
FunctionInfo function;
Signature signature = call.getSignature();
switch (signature.getName()) {
// TODO: optimize these special forms
case IF:
case NULL_IF:
case SWITCH:
case TRY_CAST:
case IS_NULL:
case "IS_DISTINCT_FROM":
case COALESCE:
case "AND":
case "OR":
case IN:
return call;
case CAST:
if (call.getArguments().get(0).getType().equals(UnknownType.UNKNOWN)) {
return constantNull(call.getType());
}
function = registry.getCoercion(call.getArguments().get(0).getType(), call.getType());
break;
default:
function = registry.getExactFunction(signature);
if (function == null) {
// TODO: temporary hack to deal with magic timestamp literal functions which don't have an "exact" form and need to be "resolved"
function = registry.resolveFunction(QualifiedName.of(signature.getName()), signature.getArgumentTypes(), false);
}
}
List<RowExpression> arguments = Lists.transform(call.getArguments(), new Function<RowExpression, RowExpression>()
{