|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.ValueNode
org.apache.derby.impl.sql.compile.OperatorNode
org.apache.derby.impl.sql.compile.UnaryOperatorNode
org.apache.derby.impl.sql.compile.WindowFunctionNode
public abstract class WindowFunctionNode
Superclass of any window function call.
| Field Summary | |
|---|---|
private ResultColumn |
generatedRC
|
private ColumnReference |
generatedRef
|
private WindowNode |
window
|
| Fields inherited from class org.apache.derby.impl.sql.compile.UnaryOperatorNode |
|---|
methodName, operand, operator, receiverInterfaceType, resultInterfaceType, UnaryArgTypes, UnaryMethodNames, UnaryOperators, UnaryResultTypes, XMLPARSE_OP, XMLSERIALIZE_OP |
| Fields inherited from class org.apache.derby.impl.sql.compile.ValueNode |
|---|
transformed |
| Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
|---|
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, isPrivilegeCollectionRequired |
| Constructor Summary | |
|---|---|
WindowFunctionNode()
|
|
| Method Summary | |
|---|---|
ValueNode |
bindExpression(FromList fromList,
SubqueryList subqueryList,
java.util.List aggregateVector)
ValueNode override. |
boolean |
constantExpression(PredicateList whereClause)
ValueNode override. |
private WindowDefinitionNode |
definedWindow(WindowList windows,
java.lang.String name)
|
ColumnReference |
getGeneratedRef()
Get the generated ColumnReference to this window function after the parent called replaceCallsWithColumnReferences(). |
ValueNode |
getNewNullResultExpression()
Get the null result expression column. |
WindowNode |
getWindow()
|
void |
init(java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
Initializer for a WindowFunctionNode |
boolean |
isConstantExpression()
ValueNode override. |
void |
printSubNodes(int depth)
QueryTreeNode override. |
ValueNode |
replaceCallsWithColumnReferences(ResultColumnList rcl,
int tableNumber)
Replace window function calls in the expression tree with a ColumnReference to that window function, append the aggregate to the supplied RCL (assumed to be from the child ResultSetNode) and return the ColumnReference. |
void |
setWindow(WindowDefinitionNode wdn)
Set window associated with this window function call. |
| Methods inherited from class org.apache.derby.impl.sql.compile.UnaryOperatorNode |
|---|
acceptChildren, addXmlOpMethodParams, bindOperand, bindParameter, categorize, generateExpression, getOperand, getOperatorString, getOrderableVariantType, getParameterOperand, getReceiverInterfaceName, init, isEquivalent, preprocess, remapColumnReferencesToExpressions, setMethodName, setOperator, toString |
| Methods inherited from class org.apache.derby.impl.sql.compile.OperatorNode |
|---|
pushSqlXmlUtil |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private WindowNode window
private ResultColumn generatedRC
private ColumnReference generatedRef
| Constructor Detail |
|---|
public WindowFunctionNode()
| Method Detail |
|---|
public void init(java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
init in interface Nodeinit in class UnaryOperatorNodearg1 - null (operand)arg2 - function mame (operator)arg3 - window node (definition or reference)
StandardExceptionpublic boolean isConstantExpression()
isConstantExpression in class UnaryOperatorNodeValueNode.isConstantExpression()public boolean constantExpression(PredicateList whereClause)
constantExpression in class UnaryOperatorNodeValueNode.isConstantExpression()public WindowNode getWindow()
public void setWindow(WindowDefinitionNode wdn)
wdn - window definition
public ValueNode bindExpression(FromList fromList,
SubqueryList subqueryList,
java.util.List aggregateVector)
throws StandardException
bindExpression in class UnaryOperatorNodefromList - The FROM list for the query this
expression is in, for binding columns.subqueryList - The subquery list being built as we find SubqueryNodesaggregateVector - The aggregate vector being built as we find AggregateNodes
StandardException - Thrown on errorValueNode.bindExpression(org.apache.derby.impl.sql.compile.FromList, org.apache.derby.impl.sql.compile.SubqueryList, java.util.List)
private WindowDefinitionNode definedWindow(WindowList windows,
java.lang.String name)
public void printSubNodes(int depth)
printSubNodes in class UnaryOperatorNodedepth - The depth of this node in the treeQueryTreeNode.printSubNodes(int)
public ValueNode replaceCallsWithColumnReferences(ResultColumnList rcl,
int tableNumber)
throws StandardException
rcl - The RCL to append to.tableNumber - The tableNumber for the new ColumnReference
StandardException - Thrown on errorpublic ColumnReference getGeneratedRef()
SELECT * FROM t WHERE EXISTS
(SELECT ROW_NUMBER() OVER () FROM t)
in which case the top PRN of the subquery sitting over a
WindowResultSetNode just contains a RC which is boolean constant true. This means that the replaceCallsWithColumnReferences will not
have been called for this, so the returned generatedRef
is null.
public ValueNode getNewNullResultExpression()
throws StandardException
StandardException - on error
|
Built on Wed 2013-06-12 15:21:56+0000, from revision ??? | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||