Class GroupByList
java.lang.Object
org.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.QueryTreeNodeVector<GroupByColumn>
org.apache.derby.impl.sql.compile.OrderedColumnList<GroupByColumn>
org.apache.derby.impl.sql.compile.GroupByList
- All Implemented Interfaces:
Iterable<GroupByColumn>, Visitable
A GroupByList represents the list of expressions in a GROUP BY clause in
a SELECT statement.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) int(package private) booleanFields inherited from class QueryTreeNodeVector
eltClassFields inherited from class QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddGroupByColumn(GroupByColumn column) Add a column to the list(package private) voidbindGroupByColumns(SelectNode select, List<AggregateNode> aggregates) Bind the group by list.(package private) GroupByColumnfindGroupingColumn(ValueNode node) Find the matching grouping column if any for the given expression(package private) GroupByColumngetGroupByColumn(int position) Get a column from the list(package private) intGet the number of grouping columns that need to be added to the SELECT list.(package private) booleanisRollup()(package private) voidpreprocess(int numTables, FromList fromList, SubqueryList whereSubquerys, PredicateList wherePredicates) (package private) voidRemap all ColumnReferences in this tree to be clones of the underlying expression.(package private) voidtoString()Convert this object to a String.Methods inherited from class OrderedColumnList
getColumnOrderingMethods inherited from class QueryTreeNodeVector
acceptChildren, addElement, destructiveAppend, elementAt, indexOf, insertElementAt, iterator, nondestructiveAppend, printSubNodes, removeAllElements, removeElement, removeElementAt, setElementAt, sizeMethods inherited from class QueryTreeNode
accept, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generate, 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, verifyClassExistMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Field Details
-
numGroupingColsAdded
int numGroupingColsAdded -
rollup
boolean rollup
-
-
Constructor Details
-
GroupByList
-
-
Method Details
-
addGroupByColumn
Add a column to the list- Parameters:
column- The column to add to the list
-
getGroupByColumn
Get a column from the list- Parameters:
position- The column to get from the list
-
setRollup
void setRollup() -
isRollup
boolean isRollup() -
getNumNeedToAddGroupingCols
int getNumNeedToAddGroupingCols()Get the number of grouping columns that need to be added to the SELECT list.- Returns:
- int The number of grouping columns that need to be added to the SELECT list.
-
bindGroupByColumns
Bind the group by list. Verify: o Number of grouping columns matches number of non-aggregates in SELECT's RCL. o Names in the group by list are unique o Names of grouping columns match names of non-aggregate expressions in SELECT's RCL.- Parameters:
select- The SelectNodeaggregates- The aggregate list being built as we find AggregateNodes- Throws:
StandardException- Thrown on error
-
findGroupingColumn
Find the matching grouping column if any for the given expression- Parameters:
node- an expression for which we are trying to find a match in the group by list.- Returns:
- the matching GroupByColumn if one exists, null otherwise.
- Throws:
StandardException
-
remapColumnReferencesToExpressions
Remap all ColumnReferences in this tree to be clones of the underlying expression.- Throws:
StandardException- Thrown on error
-
toString
Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.- Overrides:
toStringin classQueryTreeNode- Returns:
- This object as a String
-
preprocess
void preprocess(int numTables, FromList fromList, SubqueryList whereSubquerys, PredicateList wherePredicates) throws StandardException - Throws:
StandardException
-