public static IExternalFunction getExternalFunctionEvaluator(IExternalFunctionInfo finfo,
IScalarEvaluatorFactory args[], IHyracksTaskContext context, IApplicationContext appCtx)
throws HyracksDataException {
switch (finfo.getKind()) {
case SCALAR:
return new ExternalScalarFunction(finfo, args, context, appCtx);
case AGGREGATE:
case UNNEST:
throw new RuntimeDataException(ErrorCode.LIBRARY_EXTERNAL_FUNCTION_UNSUPPORTED_KIND, finfo.getKind());
default:
throw new RuntimeDataException(ErrorCode.LIBRARY_EXTERNAL_FUNCTION_UNKNOWN_KIND, finfo.getKind());
}
}
}