union2.removePrecedingOperator(prec2);
/*
* get the index scan in first subgraph
*/
BasicIndexScan bis = getIndexScan(sg1.getRootOfSubgraph());
if (bis == null)
continue;
/*
* you have to clone this list, because if changing
* something, the list is updated immediately, but we want
* to access the removed items later!
*/
List<OperatorIDTuple> _bisSucc = bis
.getSucceedingOperators();
List<OperatorIDTuple> bisSucc = new ArrayList<>(
_bisSucc.size());
for (OperatorIDTuple toClone : _bisSucc) {
bisSucc.add(toClone);
}
/*
* now add the 2nd subgraph container in the first subgraph
* container
*/
sg1.getRootOfSubgraph().addSucceedingOperator(sg2);
/*
* remove old connections of the 2nd subgraph (because it
* should be included into the subgraph)
*/
for (OperatorIDTuple op : bisSucc) {
bis.removeSucceedingOperator(op);
op.getOperator().removePrecedingOperator(bis);
}
/*
* connect the basic index scan and the 2nd subgraph
* container in the join-operator in the 1st subgraph
* container
*/
bis.addSucceedingOperator(smallJoin, 0);
smallJoin.addPrecedingOperator(sg2);
sg2.addSucceedingOperator(smallJoin, 1);
smallJoin.addPrecedingOperator(bis);
/*
* now connect the join with the succeeding operators of the