org.apache.derby.impl.sql.compile
Class ReplaceWindowFuncCallsWithCRVisitor

java.lang.Object
  extended by org.apache.derby.impl.sql.compile.ReplaceWindowFuncCallsWithCRVisitor
All Implemented Interfaces:
Visitor

public class ReplaceWindowFuncCallsWithCRVisitor
extends java.lang.Object
implements Visitor

Replace all window function calls with result columns.


Field Summary
private  ResultColumnList rcl
           
private  java.lang.Class skipOverClass
           
private  int tableNumber
           
 
Constructor Summary
ReplaceWindowFuncCallsWithCRVisitor(ResultColumnList rcl, int tableNumber, java.lang.Class skipOverClass)
          Replace all window function calls with column references.
 
Method Summary
 boolean skipChildren(Visitable node)
          Don't visit childen under the skipOverClass node, if it isn't null.
 boolean stopTraversal()
          Vistor override.
 Visitable visit(Visitable node)
          Don't do anything unless we have a window function node node.
 boolean visitChildrenFirst(Visitable node)
          Vistor override.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rcl

private ResultColumnList rcl

skipOverClass

private java.lang.Class skipOverClass

tableNumber

private int tableNumber
Constructor Detail

ReplaceWindowFuncCallsWithCRVisitor

public ReplaceWindowFuncCallsWithCRVisitor(ResultColumnList rcl,
                                           int tableNumber,
                                           java.lang.Class skipOverClass)
Replace all window function calls with column references. Add the reference to the RCL. Delegates most work to WindowFunctionNode.replaceCallsWithColumnReferences(rcl, tableNumber).

Parameters:
rcl - the result column list
tableNumber - The tableNumber for the new CRs
skipOverClass - Don't go past this
Method Detail

visit

public Visitable visit(Visitable node)
                throws StandardException
Don't do anything unless we have a window function node node. Vistor override.

Specified by:
visit in interface Visitor
Parameters:
node - the node to process
Returns:
a query tree node. Often times this is the same node that was passed in, but Visitors that replace nodes with other nodes will use this to return the new replacement node.
Throws:
StandardException - may be throw an error as needed by the visitor (i.e. may be a normal error if a particular node is found, e.g. if checking a group by, we don't expect to find any ColumnReferences that aren't under an AggregateNode -- the easiest thing to do is just throw an error when we find the questionable node).
See Also:
Visitor.visit(org.apache.derby.iapi.sql.compile.Visitable)

skipChildren

public boolean skipChildren(Visitable node)
Don't visit childen under the skipOverClass node, if it isn't null. Vistor override.

Specified by:
skipChildren in interface Visitor
Parameters:
node - the node to process
Returns:
true/false
See Also:
Visitor.skipChildren(org.apache.derby.iapi.sql.compile.Visitable)

visitChildrenFirst

public boolean visitChildrenFirst(Visitable node)
Vistor override.

Specified by:
visitChildrenFirst in interface Visitor
Parameters:
node - the top node of a sub-tree about to be visited
Returns:
false
See Also:
Visitor.visitChildrenFirst(org.apache.derby.iapi.sql.compile.Visitable)

stopTraversal

public boolean stopTraversal()
Vistor override.

Specified by:
stopTraversal in interface Visitor
Returns:
false
See Also:
Visitor.skipChildren(org.apache.derby.iapi.sql.compile.Visitable)

Built on Thu 2010-12-23 20:49:13+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.