Inline agg

This is part 1: Serial Inline aggregation contain table agg and group by agg with index.

Waiting for Jenkins.

I don't know what "accessPlanTemp != null" represents here but I think that I'd rather see a few lines of code repeated to get rid of accessPlanTemp and all the repeated branching. Would this be better over all?:

        /*
         * Push this node down to partition if it's distributed. First remove
         * the send/receive pair, add the node, then put the send/receive pair
         * back on top of the node, followed by another top node at the
         * coordinator.
         */
        if (coordNode != null && root instanceof ReceivePlanNode) {
            AbstractPlanNode accessPlanTemp = root;
            root = root.getChild(0).getChild(0);
            root.clearParents();
            distNode.addAndLinkChild(root);
            root = distNode;
            // Put the send/receive pair back into place
            accessPlanTemp.getChild(0).clearChildren();
            accessPlanTemp.getChild(0).addAndLinkChild(root);
            root = accessPlanTemp;
            // Add the top node
            if (needCoordNode) {
                coordNode.addAndLinkChild(root);
                root = coordNode;
                // Set post predicate for top Aggregation node
                coordNode.setPostPredicate(m_parsedSelect.m_having);
            } else {
                // Set post predicate for final distributed Aggregation node
                distNode.setPostPredicate(m_parsedSelect.m_having);
            }
        } else {
            distNode.addAndLinkChild(root);
            root = distNode;
            // Set post predicate for final distributed Aggregation node
            distNode.setPostPredicate(m_parsedSelect.m_having);
        }

        if (selectStmt.hasComplexAgg()) { ...