expCalcs[i] = new CalcExp(calc, scalarCalc, listCalc, iterCalc);
}
// Create a new instance of the UDF, because some UDFs use member
// variables as state.
UserDefinedFunction udf2 = factory.create();
if (call.getType() instanceof SetType) {
return new ListCalcImpl(call, calcs, udf2, expCalcs);
} else {
return new ScalarCalcImpl(call, calcs, udf2, expCalcs);
}