org.apache.derby.impl.sql.compile
Class WindowResultSetNode
java.lang.Object
org.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.ResultSetNode
org.apache.derby.impl.sql.compile.FromTable
org.apache.derby.impl.sql.compile.SingleChildResultSetNode
org.apache.derby.impl.sql.compile.WindowResultSetNode
- All Implemented Interfaces:
- Optimizable, Visitable
public class WindowResultSetNode
- extends SingleChildResultSetNode
A WindowResultSetNode represents a result set for a window partitioning on a
select. Modelled on the code in GroupByNode.
Fields inherited from class org.apache.derby.impl.sql.compile.FromTable |
ADD_PLAN, bestAccessPath, bestCostEstimate, bestSortAvoidancePath, correlationName, corrTableName, currentAccessPath, hashKeyColumns, initialCapacity, level, LOAD_PLAN, loadFactor, maxCapacity, origTableName, REMOVE_PLAN, tableNumber, tableProperties, trulyTheBestAccessPath, userSpecifiedJoinStrategy |
Methods inherited from class org.apache.derby.impl.sql.compile.SingleChildResultSetNode |
acceptChildren, addNewPredicate, adjustForSortElimination, adjustForSortElimination, changeAccessPath, decrementLevel, ensurePredicateList, flattenableInFromSubquery, forUpdate, getChildResult, getFinalCostEstimate, getFromTableByName, getTrulyTheBestAccessPath, init, initAccessPaths, isNotExists, isOneRowResultSet, isOrderedOn, modifyAccessPaths, optimize, preprocess, pullOptPredicates, pushExpressions, referencesSessionSchema, referencesTarget, reflectionNeededForProjection, setChildResult, setLevel, subqueryReferencesTarget, updateBestPlanMap, updateTargetLockMode |
Methods inherited from class org.apache.derby.impl.sql.compile.FromTable |
assignCostEstimate, canBeOrdered, considerSortAvoidancePath, convertAbsoluteToRelativeColumnPosition, cursorTargetTable, estimateCost, feasibleJoinStrategy, fillInReferencedTableMap, flatten, getBaseTableName, getBestAccessPath, getBestSortAvoidancePath, getCorrelationName, getCostEstimate, getCurrentAccessPath, getExposedName, getLevel, getName, getNumColumnsReturned, getOrigTableName, getProperties, getResultColumnsForList, getSchemaDescriptor, getSchemaDescriptor, getScratchCostEstimate, getTableDescriptor, getTableName, getTableNumber, getUserSpecifiedJoinStrategy, hashKeyColumns, hasTableNumber, initialCapacity, isBaseTable, isCoveringIndex, isFlattenableJoinNode, isMaterializable, isOneRowScan, isTargetTable, legalJoinOrder, loadFactor, LOJ_reorderable, markUpdatableByCursor, maxCapacity, memoryUsageOK, modifyAccessPath, needsSpecialRCLBinding, nextAccessPath, optimizeIt, optimizeSubqueries, pushOptPredicate, rememberAsBest, rememberJoinStrategyAsBest, rememberSortAvoidancePath, resetJoinStrategies, setCostEstimate, setHashKeyColumns, setOrigTableName, setProperties, setTableNumber, startOptimizing, supportsMultipleInstantiations, tellRowOrderingAboutConstantColumns, toString, transformOuterJoins, uniqueJoin, verifyProperties |
Methods inherited from class org.apache.derby.impl.sql.compile.ResultSetNode |
assignResultSetNumber, bindExpressions, bindExpressionsWithTables, bindNonVTITables, bindResultColumns, bindResultColumns, bindTargetExpressions, bindUntypedNullsToResultColumns, bindVTITables, columnTypesAndLengthsMatch, considerMaterialization, disablePrivilegeCollection, enhanceRCLForInsert, generateNormalizationResultSet, generateResultSet, genProjectRestrict, genProjectRestrict, genProjectRestrictForReordering, getAllResultColumns, getCostEstimate, getCursorTargetTable, getFromList, getMatchingColumn, getNewCostEstimate, getOptimizer, getOptimizerImpl, getRCLForInsert, getReferencedTableMap, getResultColumns, getResultSetNumber, isPossibleDistinctScan, isUpdatableCursor, LOJgetReferencedTables, makeResultDescription, makeResultDescriptors, markAsCursorTargetTable, markForDistinctScan, markStatementResultSet, modifyAccessPaths, notCursorTargetTable, notFlattenableJoin, numDistinctAggregates, parseDefault, performMaterialization, projectResultColumns, pushOffsetFetchFirst, pushOrderByList, rejectParameters, rejectXMLValues, renameGeneratedResultNames, replaceOrForbidDefaults, returnsAtMostOneRow, setInsertSource, setReferencedTableMap, setResultColumns, setResultToBooleanTrueNode, setTableConstructorTypes, verifySelectStarSubquery |
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
accept, bindOffsetFetch, bindRowMultiSet, bindUserType, checkReliability, checkReliability, convertDefaultNode, createTypeDependency, debugFlush, debugPrint, formatNodeString, foundString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContextManager, getCursorInfo, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getNodeFactory, getNodeType, getNullNode, getParameterTypes, getRowEstimate, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, init, init, init, init, init, init, init, init, init, init, init, init, isAtomic, isInstanceOf, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, orReliability, parseStatement, printLabel, resolveTableToSynonym, setBeginOffset, setContextManager, setEndOffset, setNodeType, setRefActionInfo, stackPrint, treePrint, treePrint, verifyClassExist |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
parent
FromTable parent
- The parent to the WindowResultSetNode. We generate a ProjectRestrict
over the windowing node and parent is set to that node.
windowFuncCalls
java.util.Vector windowFuncCalls
wdn
WindowDefinitionNode wdn
WindowResultSetNode
public WindowResultSetNode()
init
public void init(java.lang.Object bottomPR,
java.lang.Object windowDef,
java.lang.Object windowFuncCalls,
java.lang.Object nestingLevel)
throws StandardException
- Intializer for a WindowResultSetNode.
- Overrides:
init
in class QueryTreeNode
- Parameters:
bottomPR
- The project restrict result set we want to wrapwindowDef
- The window definitionwindowFuncCalls
- All window function calls in SELECT's select list
and order by list.nestingLevel
- Nesting level
- Throws:
StandardException
- Thrown on error
addNewPRNode
private void addNewPRNode()
throws StandardException
- Add a new PR node. Put the new PR under any sort.
- Throws:
standard
- exception
StandardException
colRefAlreadySeen
private boolean colRefAlreadySeen(java.util.Vector uniqueColRefs,
ColumnReference cand)
throws StandardException
- Returns:
- true if an equivalent column reference to cand is already
present in uniqueColRefs
- Throws:
StandardException
addNewColumns
private void addNewColumns()
throws StandardException
- Substitute new result columns for window function calls and add the
result columns to childResult's list of columns.
- Throws:
StandardException
generate
public void generate(ActivationClassBuilder acb,
MethodBuilder mb)
throws StandardException
- override
- Overrides:
generate
in class QueryTreeNode
- Parameters:
acb
- The ActivationClassBuilder for the class being builtmb
- The method for the generated code to go into
- Throws:
StandardException
- Thrown on error- See Also:
QueryTreeNode.generate(org.apache.derby.impl.sql.compile.ActivationClassBuilder, org.apache.derby.iapi.services.compiler.MethodBuilder)
getParent
public FromTable getParent()
- Returns:
- parent of this node, a PRN, used by SelectNode to retrieve new
top result set node after window result set rewrite of result set tree.
printSubNodes
public void printSubNodes(int depth)
- QueryTreeNode override
- Overrides:
printSubNodes
in class SingleChildResultSetNode
- Parameters:
depth
- The depth of this node in the tree- See Also:
QueryTreeNode.printSubNodes(int)
Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.