public static FunctionHolderExpression getFunctionExpression(String name, MajorType returnType, FunctionImplementationRegistry registry, HoldingContainer... args) {
List<MajorType> argTypes = new ArrayList<MajorType>(args.length);
List<LogicalExpression> argExpressions = new ArrayList<LogicalExpression>(args.length);
for(HoldingContainer c : args) {
argTypes.add(c.getMajorType());
argExpressions.add(new HoldingContainerExpression(c));
}
DrillFuncHolder holder = registry.findExactMatchingDrillFunction(name, argTypes, returnType);
if (holder != null) {
return holder.getExpr(name, argExpressions, ExpressionPosition.UNKNOWN);