rightOp.setChildOperators(child);
List<Operator<? extends Serializable>> parent = leftOp.getParentOperators();
parent.add(rightOp);
unionDesc uDesc = ((UnionOperator)leftOp).getConf();
uDesc.setNumInputs(uDesc.getNumInputs()+1);
return putOpInsertMap(leftOp, unionoutRR);
}
else {
// make right a child of left
List<Operator<? extends Serializable>> child = new ArrayList<Operator<? extends Serializable>>();
child.add(rightOp);
leftOp.setChildOperators(child);
List<Operator<? extends Serializable>> parent = rightOp.getParentOperators();
parent.add(leftOp);
unionDesc uDesc = ((UnionOperator)rightOp).getConf();
uDesc.setNumInputs(uDesc.getNumInputs()+1);
return putOpInsertMap(rightOp, unionoutRR);
}
}
// Create a new union operator
Operator<? extends Serializable> unionforward =
OperatorFactory.getAndMakeChild(new unionDesc(), new RowSchema(unionoutRR.getColumnInfos()));
// set union operator as child of each of leftOp and rightOp
List<Operator<? extends Serializable>> child = new ArrayList<Operator<? extends Serializable>>();
child.add(unionforward);
rightOp.setChildOperators(child);