Class ReplaceAggregatesWithCRVisitor
java.lang.Object
org.apache.derby.impl.sql.compile.ReplaceAggregatesWithCRVisitor
- All Implemented Interfaces:
Visitor
Replace all aggregates with result columns.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionReplaceAggregatesWithCRVisitor
(ResultColumnList rcl, int tableNumber) Replace all aggregates with column references.ReplaceAggregatesWithCRVisitor
(ResultColumnList rcl, int tableNumber, Class<?> skipOverClass) ReplaceAggregatesWithCRVisitor
(ResultColumnList rcl, Class<?> nodeToSkip) Replace all aggregates with column references. -
Method Summary
Modifier and TypeMethodDescriptionboolean
skipChildren
(Visitable node) Don't visit children under the skipOverClass node, if it isn't null.boolean
Method that is called to see if query tree traversal should be stopped before visiting all nodes.Don't do anything unless we have an aggregate node.boolean
visitChildrenFirst
(Visitable node) Method that is called to see ifvisit()
should be called on the children ofnode
before it is called onnode
itself.
-
Field Details
-
rcl
-
skipOverClass
-
tableNumber
private int tableNumber
-
-
Constructor Details
-
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 listtableNumber
- The tableNumber for the new CRs
-
ReplaceAggregatesWithCRVisitor
ReplaceAggregatesWithCRVisitor(ResultColumnList rcl, int tableNumber, Class<?> skipOverClass) -
ReplaceAggregatesWithCRVisitor
ReplaceAggregatesWithCRVisitor(ResultColumnList rcl, 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 listnodeToSkip
- don't examine anything below nodeToSkip
-
-
Method Details
-
visit
Don't do anything unless we have an aggregate node.- Specified by:
visit
in interfaceVisitor
- Parameters:
node
- the node to process- Returns:
- me
- Throws:
StandardException
- on error
-
skipChildren
Don't visit children under the skipOverClass node, if it isn't null.- Specified by:
skipChildren
in interfaceVisitor
- Parameters:
node
- the node to process- Returns:
- true/false
-
visitChildrenFirst
Description copied from interface:Visitor
Method that is called to see ifvisit()
should be called on the children ofnode
before it is called onnode
itself. If this method always returnstrue
, the visitor will walk the tree bottom-up. If it always returnsfalse
, the tree is visited top-down.- Specified by:
visitChildrenFirst
in interfaceVisitor
- Parameters:
node
- the top node of a sub-tree about to be visited- Returns:
true
ifnode
's children should be visited beforenode
,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 interfaceVisitor
- Returns:
- true/false
-