}
FunctionArguments args = new FunctionArguments(onlyConstants, includesAggregates, evals, call);
if(call.getDefinition().isAggregating()){
if(args.includesAggregates()) throw new SetupException(String.format("The call for %s contains one or more arguments that also contain aggregating functions. An aggregating function cannot contain aggregating expressions.", call.getDefinition()));
BasicEvaluator e = FunctionEvaluatorRegistry.getEvaluator(call.getDefinition().getName(), args, record);
if(!(e instanceof AggregatingEvaluator ) ){
throw new SetupException(String.format("Function %s is an aggregating function. However, the provided evaluator (%s) is not an aggregating evaluator.", call.getDefinition(), e.getClass()));
}
aggregators.add( (AggregatingEvaluator) e);
return e;
}else{
BasicEvaluator e = FunctionEvaluatorRegistry.getEvaluator(call.getDefinition().getName(), args, record);
return e;
}
}