Visitable
AggregateWindowFunctionNode
, RowNumberFunctionNode
public 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_INDEX
K_BASE, K_XMLPARSE, K_XMLSERIALIZE, kind, methodName, operand, operator, receiverInterfaceType, resultInterfaceType, UnaryArgTypes, UnaryMethodNames, UnaryOperators, UnaryResultTypes
transformed
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, wait
pushSqlXmlUtil
accept, 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, verifyClassExist
acceptChildren, addXmlOpMethodParams, bindOperand, bindParameter, categorize, generateExpression, getOperand, getOperatorString, getOrderableVariantType, getParameterOperand, getReceiverInterfaceName, isEquivalent, isSameNodeKind, preprocess, remapColumnReferencesToExpressions, setMethodName, setOperator, toString
bindExpression, 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, verifyPutAndsOnTop
private 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 managerStandardException
public boolean isConstantExpression()
isConstantExpression
in class UnaryOperatorNode
ValueNode.isConstantExpression()
boolean constantExpression(PredicateList whereClause)
constantExpression
in class UnaryOperatorNode
ValueNode.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 UnaryOperatorNode
fromList
- 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 UnaryOperatorNode
depth
- 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.