//
// put the delete node in the right place
//
// get the recv node
ReceivePlanNode recvNode = (ReceivePlanNode) subSelectRoot;
// get the send node
assert (recvNode.getChildPlanNodeCount() == 1);
AbstractPlanNode sendNode = recvNode.getChild(0);
// get the scan node and unlink
assert (sendNode.getChildPlanNodeCount() == 1);
AbstractPlanNode scanNode = sendNode.getChild(0);
sendNode.unlinkChild(scanNode);
// link in the delete node
assert (scanNode instanceof AbstractScanPlanNode);
scanNode.addInlinePlanNode(projectionNode);
deleteNode.addAndLinkChild(scanNode);
AbstractPlanNode combineNode = insertCountInDMLPlan(deleteNode);
sendNode.addAndLinkChild(combineNode);
// fix the receive node's output columns
recvNode.updateOutputColumns(m_catalogDb);
/*
* recvNode.getOutputColumnNames().clear();
* recvNode.getOutputColumnSizes().clear();
* recvNode.getOutputColumnTypes().clear(); for (OutputColumnInfo
* oci : recvNode.getOutputColumnGUIDs()) {