// collapsing
List<Channel> inputs = new ArrayList<Channel>();
collect(in1, inputs);
collect(in2, inputs);
newUnionNode = new NAryUnionPlanNode(unionNode.getOptimizerNode(), inputs, unionNode.getGlobalProperties());
// adjust the input channels to have their target point to the new union node
for (Channel c : inputs) {
c.setTarget(newUnionNode);
}