Top Description Fields Constructors Methods
org.apache.derby.impl.sql.compile

pack-priv Class ReplaceWindowFuncCallsWithCRVisitor

extends Object
implements Visitor
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.compile.Visitor
Imports
org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.sql.compile.Visitable, .Visitor

Replace all window function calls with result columns.

Field Summary

Modifier and TypeField and Description
private ResultColumnList
private Class<?>
private int

Constructor Summary

AccessConstructor and Description
pack-priv
ReplaceWindowFuncCallsWithCRVisitor(ResultColumnList
the result column list
rcl
,
int
The tableNumber for the new CRs
tableNumber
,
Class<?>
Don't go past this
skipOverClass
)

Replace all window function calls with column references.

Method Summary

Modifier and TypeMethod and Description
public boolean
skipChildren(Visitable
the node to process
node
)

Implements org.apache.derby.iapi.sql.compile.Visitor.skipChildren.

Don't visit children under the skipOverClass node, if it isn't null.

public boolean

Returns:

false
stopTraversal
()

Implements org.apache.derby.iapi.sql.compile.Visitor.stopTraversal.

Visitor override.

public Visitable
visit(Visitable
the node to process
node
)

Implements org.apache.derby.iapi.sql.compile.Visitor.visit.

Don't do anything unless we have a window function node node.

public boolean

Returns:

false
visitChildrenFirst
(Visitable
the top node of a sub-tree about to be visited
node
)

Implements org.apache.derby.iapi.sql.compile.Visitor.visitChildrenFirst.

Visitor override.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

rclback to summary
private ResultColumnList rcl
skipOverClassback to summary
private Class<?> skipOverClass
tableNumberback to summary
private int tableNumber

Constructor Detail

ReplaceWindowFuncCallsWithCRVisitorback to summary
pack-priv ReplaceWindowFuncCallsWithCRVisitor(ResultColumnList rcl, int tableNumber, 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:ResultColumnList

the result column list

tableNumber:int

The tableNumber for the new CRs

skipOverClass:Class<?>

Don't go past this

Method Detail

skipChildrenback to summary
public boolean skipChildren(Visitable node)

Implements org.apache.derby.iapi.sql.compile.Visitor.skipChildren.

Don't visit children under the skipOverClass node, if it isn't null. Visitor override.

Parameters
node:Visitable

Doc from org.apache.derby.iapi.sql.compile.Visitor.skipChildren.

the node to process

Returns:boolean

Doc from org.apache.derby.iapi.sql.compile.Visitor.skipChildren.

true/false

See Also
Visitor#skipChildren
stopTraversalback to summary
public boolean stopTraversal()

Implements org.apache.derby.iapi.sql.compile.Visitor.stopTraversal.

Visitor override.

Returns:boolean

false

See Also
Visitor#skipChildren
visitback to summary
public Visitable visit(Visitable node) throws StandardException

Implements org.apache.derby.iapi.sql.compile.Visitor.visit.

Don't do anything unless we have a window function node node. Visitor override.

Parameters
node:Visitable

Doc from org.apache.derby.iapi.sql.compile.Visitor.visit.

the node to process

Returns:Visitable

Doc from org.apache.derby.iapi.sql.compile.Visitor.visit.

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.

Exceptions
StandardException:

Doc from org.apache.derby.iapi.sql.compile.Visitor.visit.

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
visitChildrenFirstback to summary
public boolean visitChildrenFirst(Visitable node)

Implements org.apache.derby.iapi.sql.compile.Visitor.visitChildrenFirst.

Visitor override.

Parameters
node:Visitable

Doc from org.apache.derby.iapi.sql.compile.Visitor.visitChildrenFirst.

the top node of a sub-tree about to be visited

Returns:boolean

false

See Also
Visitor#visitChildrenFirst