public Calc compileCall(ResolvedFunCall call, ExpCompiler compiler) {
String allString = getLiteralArg(call, 2, "DISTINCT", ReservedWords);
final boolean all = allString.equalsIgnoreCase("ALL");
// todo: do at validate time
checkCompatible(call.getArg(0), call.getArg(1), null);
final ListCalc listCalc0 =
compiler.compileList(call.getArg(0));
final ListCalc listCalc1 =
compiler.compileList(call.getArg(1));
return new AbstractListCalc(call, new Calc[] {listCalc0, listCalc1}) {
public List evaluateList(Evaluator evaluator) {
List list0 = listCalc0.evaluateList(evaluator);
List list1 = listCalc1.evaluateList(evaluator);
return union(list0, list1, all);
}
};
}