use of io.prestosql.spi.function.FunctionMetadata in project hetu-core by openlookeng.
the class SpatialJoinUtils method getFlippedFunctionHandle.
public static FunctionHandle getFlippedFunctionHandle(CallExpression callExpression, FunctionAndTypeManager functionAndTypeManager) {
FunctionMetadata callExpressionMetadata = functionAndTypeManager.getFunctionMetadata(callExpression.getFunctionHandle());
checkArgument(callExpressionMetadata.getOperatorType().isPresent());
OperatorType operatorType = flip(callExpressionMetadata.getOperatorType().get());
List<TypeSignatureProvider> typeProviderList = fromTypes(callExpression.getArguments().stream().map(RowExpression::getType).collect(toImmutableList()));
checkArgument(typeProviderList.size() == 2, "Expected there to be only two arguments in type provider");
return functionAndTypeManager.resolveOperatorFunctionHandle(operatorType, ImmutableList.of(typeProviderList.get(1), typeProviderList.get(0)));
}
Aggregations