Search in sources :

Example 1 with RemoteScalarFunctionImplementation

use of com.facebook.presto.spi.function.RemoteScalarFunctionImplementation in project presto by prestodb.

the class SqlFunctionExecutors method executeFunction.

public CompletableFuture<SqlFunctionResult> executeFunction(String source, ScalarFunctionImplementation functionImplementation, Page input, List<Integer> channels, List<Type> argumentTypes, Type returnType) {
    checkArgument(functionImplementation instanceof RemoteScalarFunctionImplementation, format("Only support RemoteScalarFunctionImplementation, got %s", functionImplementation.getClass()));
    FunctionImplementationType implementationType = ((RemoteScalarFunctionImplementation) functionImplementation).getImplementationType();
    checkState(sqlFunctionExecutor.getImplementationType().equals(implementationType), format("%s SQL function executor is not setup", implementationType));
    return sqlFunctionExecutor.executeFunction(source, (RemoteScalarFunctionImplementation) functionImplementation, input, channels, argumentTypes, returnType);
}
Also used : RemoteScalarFunctionImplementation(com.facebook.presto.spi.function.RemoteScalarFunctionImplementation) FunctionImplementationType(com.facebook.presto.spi.function.FunctionImplementationType)

Aggregations

FunctionImplementationType (com.facebook.presto.spi.function.FunctionImplementationType)1 RemoteScalarFunctionImplementation (com.facebook.presto.spi.function.RemoteScalarFunctionImplementation)1