public abstract class WindowFunctionNode extends UnaryOperatorNode
| Modifier and Type | Field and Description |
|---|---|
private ResultColumn |
generatedRC |
private ColumnReference |
generatedRef |
private WindowNode |
window |
methodName, operand, operator, receiverInterfaceType, resultInterfaceType, UnaryArgTypes, UnaryMethodNames, UnaryOperators, UnaryResultTypes, XMLPARSE_OP, XMLSERIALIZE_OPtransformedAUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX| Constructor and Description |
|---|
WindowFunctionNode() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
acceptChildren, addXmlOpMethodParams, bindOperand, bindParameter, categorize, generateExpression, getOperand, getOperatorString, getOrderableVariantType, getParameterOperand, getReceiverInterfaceName, init, isEquivalent, preprocess, remapColumnReferencesToExpressions, setMethodName, setOperator, toStringpushSqlXmlUtilbindExpression, changeToCNF, checkIsBoolean, checkTopPredicatesForEqualsConditions, copyFields, eliminateNots, evaluateConstantExpressions, genEqualsFalseTree, generate, generateFilter, genIsNullTree, genSQLJavaSQLTree, getClone, getColumnName, getConstantValueAsObject, getDataValueFactory, getSchemaName, getSourceResultColumn, getTableName, getTablesReferenced, getTransformed, getTypeCompiler, getTypeId, getTypeServices, init, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isCloneable, isInListProbeNode, isParameterNode, isRelationalOperator, isSameNodeType, optimizableEqualityNode, putAndsOnTop, requiresTypeFromContext, selectivity, setCollationInfo, setCollationInfo, setCollationUsingCompilationSchema, setCollationUsingCompilationSchema, setNullability, setTransformed, setType, setType, setType, updatableByCursor, verifyChangeToCNF, verifyEliminateNots, verifyPutAndsOnTopaccept, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, foundString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContextManager, getCursorInfo, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getNodeFactory, getNodeType, getNullNode, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, init, init, init, init, init, init, init, init, init, init, init, isAtomic, isInstanceOf, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, orReliability, parseStatement, printLabel, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setContextManager, setEndOffset, setNodeType, setRefActionInfo, stackPrint, treePrint, treePrint, verifyClassExistprivate WindowNode window
private ResultColumn generatedRC
private ColumnReference generatedRef
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 definitionpublic 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 AggregateNodesStandardException - 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 ColumnReferenceStandardException - 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 errorApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.