Class ReplaceAggregatesWithCRVisitor

  • All Implemented Interfaces:
    Visitor

    class ReplaceAggregatesWithCRVisitor
    extends java.lang.Object
    implements Visitor
    Replace all aggregates with result columns.
    • Field Detail

      • skipOverClass

        private java.lang.Class<?> skipOverClass
      • tableNumber

        private int tableNumber
    • Constructor Detail

      • ReplaceAggregatesWithCRVisitor

        ReplaceAggregatesWithCRVisitor​(ResultColumnList rcl,
                                       int tableNumber)
        Replace all aggregates with column references. Add the reference to the RCL. Delegates most work to AggregateNode.replaceAggregatesWithColumnReferences(rcl, tableNumber).
        Parameters:
        rcl - the result column list
        tableNumber - The tableNumber for the new CRs
      • ReplaceAggregatesWithCRVisitor

        ReplaceAggregatesWithCRVisitor​(ResultColumnList rcl,
                                       int tableNumber,
                                       java.lang.Class<?> skipOverClass)
      • ReplaceAggregatesWithCRVisitor

        ReplaceAggregatesWithCRVisitor​(ResultColumnList rcl,
                                       java.lang.Class<?> nodeToSkip)
        Replace all aggregates with column references. Add the reference to the RCL. Delegates most work to AggregateNode.replaceAggregatesWithColumnReferences(rcl). Doesn't traverse below the passed in class.
        Parameters:
        rcl - the result column list
        nodeToSkip - don't examine anything below nodeToSkip
    • Method Detail

      • skipChildren

        public boolean skipChildren​(Visitable node)
        Don't visit children under the skipOverClass node, if it isn't null.
        Specified by:
        skipChildren in interface Visitor
        Parameters:
        node - the node to process
        Returns:
        true/false
      • visitChildrenFirst

        public boolean visitChildrenFirst​(Visitable node)
        Description copied from interface: Visitor
        Method that is called to see if visit() should be called on the children of node before it is called on node itself. If this method always returns true, the visitor will walk the tree bottom-up. If it always returns false, the tree is visited top-down.
        Specified by:
        visitChildrenFirst in interface Visitor
        Parameters:
        node - the top node of a sub-tree about to be visited
        Returns:
        true if node's children should be visited before node, false otherwise
      • stopTraversal

        public boolean stopTraversal()
        Description copied from interface: Visitor
        Method that is called to see if query tree traversal should be stopped before visiting all nodes. Useful for short circuiting traversal if we already know we are done.
        Specified by:
        stopTraversal in interface Visitor
        Returns:
        true/false