VisitableAggregateWindowFunctionNode, RowNumberFunctionNodepublic abstract class WindowFunctionNode extends UnaryOperatorNode
| Modifier and Type | Field | Description |
|---|---|---|
private ResultColumn |
generatedRC |
|
private ColumnReference |
generatedRef |
|
private WindowNode |
window |
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEXK_BASE, K_XMLPARSE, K_XMLSERIALIZE, kind, methodName, operand, operator, receiverInterfaceType, resultInterfaceType, UnaryArgTypes, UnaryMethodNames, UnaryOperators, UnaryResultTypestransformed| Constructor | Description |
|---|---|
WindowFunctionNode(ValueNode op,
java.lang.String functionName,
WindowNode w,
ContextManager cm) |
| Modifier and Type | Method | Description |
|---|---|---|
(package private) ValueNode |
bindExpression(FromList fromList,
SubqueryList subqueryList,
java.util.List<AggregateNode> aggregates) |
ValueNode override.
|
(package private) boolean |
constantExpression(PredicateList whereClause) |
ValueNode override.
|
private WindowDefinitionNode |
definedWindow(WindowList windows,
java.lang.String name) |
|
(package private) ColumnReference |
getGeneratedRef() |
Get the generated ColumnReference to this window function after the
parent called replaceCallsWithColumnReferences().
|
(package private) ValueNode |
getNewNullResultExpression() |
Get the null result expression column.
|
(package private) WindowNode |
getWindow() |
|
boolean |
isConstantExpression() |
ValueNode override.
|
void |
printSubNodes(int depth) |
QueryTreeNode override.
|
(package private) 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.
|
(package private) void |
setWindow(WindowDefinitionNode wdn) |
Set window associated with this window function call.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpushSqlXmlUtilaccept, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContext, getContextManager, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getLongProperty, getNullNode, getOffsetOrderedNodes, getOptimizerFactory, getOptimizerTracer, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, getUDTDesc, isAtomic, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, optimizerTracingIsOn, orReliability, parseSearchCondition, parseStatement, printLabel, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setEndOffset, setRefActionInfo, stackPrint, taggedWith, treePrint, treePrint, verifyClassExistacceptChildren, addXmlOpMethodParams, bindOperand, bindParameter, categorize, generateExpression, getOperand, getOperatorString, getOrderableVariantType, getParameterOperand, getReceiverInterfaceName, isEquivalent, isSameNodeKind, preprocess, remapColumnReferencesToExpressions, setMethodName, setOperator, toStringbindExpression, changeToCNF, checkIsBoolean, checkTopPredicatesForEqualsConditions, copyFields, eliminateNots, evaluateConstantExpressions, genEqualsFalseTree, generate, genIsNullTree, genSQLJavaSQLTree, getClone, getColumnName, getConstantValueAsObject, getDataValueFactory, getSchemaName, getSourceResultColumn, getTableName, getTablesReferenced, getTransformed, getTypeCompiler, getTypeId, getTypeServices, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isCloneable, isInListProbeNode, isParameterNode, isRelationalOperator, optimizableEqualityNode, putAndsOnTop, requiresTypeFromContext, selectivity, setCollationInfo, setCollationInfo, setCollationUsingCompilationSchema, setCollationUsingCompilationSchema, setNullability, setTransformed, setType, setType, setType, updatableByCursor, verifyChangeToCNF, verifyEliminateNots, verifyPutAndsOnTopprivate WindowNode window
private ResultColumn generatedRC
private ColumnReference generatedRef
WindowFunctionNode(ValueNode op, java.lang.String functionName, WindowNode w, ContextManager cm) throws StandardException
op - operand (null for now)functionName - operatorw - window node (definition or reference)cm - context managerStandardExceptionpublic boolean isConstantExpression()
isConstantExpression in class UnaryOperatorNodeValueNode.isConstantExpression()boolean constantExpression(PredicateList whereClause)
constantExpression in class UnaryOperatorNodeValueNode.isConstantExpression()WindowNode getWindow()
void setWindow(WindowDefinitionNode wdn)
wdn - window definitionValueNode bindExpression(FromList fromList, SubqueryList subqueryList, java.util.List<AggregateNode> aggregates) 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 SubqueryNodesaggregates - The aggregate list 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<org.apache.derby.impl.sql.compile.AggregateNode>)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)ValueNode replaceCallsWithColumnReferences(ResultColumnList rcl, int tableNumber) throws StandardException
rcl - The RCL to append to.tableNumber - The tableNumber for the new ColumnReferenceStandardException - Thrown on errorColumnReference 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.ValueNode getNewNullResultExpression() throws StandardException
StandardException - on errorApache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.