use of org.apache.asterix.om.functions.IExternalFunctionInfo in project asterixdb by apache.
the class QueryLogicalExpressionJobGen method createScalarFunctionEvaluatorFactory.
private IScalarEvaluatorFactory createScalarFunctionEvaluatorFactory(AbstractFunctionCallExpression expr, IVariableTypeEnvironment env, IOperatorSchema[] inputSchemas, JobGenContext context) throws AlgebricksException {
IScalarEvaluatorFactory[] args = codegenArguments(expr, env, inputSchemas, context);
IFunctionDescriptor fd = null;
if (!(expr.getFunctionInfo() instanceof IExternalFunctionInfo)) {
IDataFormat format = FormatUtils.getDefaultFormat();
fd = format.resolveFunction(expr, env);
} else {
ICcApplicationContext appCtx = (ICcApplicationContext) context.getAppContext();
fd = ExternalFunctionDescriptorProvider.getExternalFunctionDescriptor((IExternalFunctionInfo) expr.getFunctionInfo(), appCtx);
}
return fd.createEvaluatorFactory(args);
}
Aggregations