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) boolean
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNodeVector
eltClass
Fields inherited from class org.apache.derby.impl.sql.compile.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) void
addGroupByColumn
(GroupByColumn column) Add a column to the list(package private) void
bindGroupByColumns
(SelectNode select, List<AggregateNode> aggregates) Bind the group by list.(package private) GroupByColumn
findGroupingColumn
(ValueNode node) Find the matching grouping column if any for the given expression(package private) GroupByColumn
getGroupByColumn
(int position) Get a column from the list(package private) int
Get the number of grouping columns that need to be added to the SELECT list.(package private) boolean
isRollup()
(package private) void
preprocess
(int numTables, FromList fromList, SubqueryList whereSubquerys, PredicateList wherePredicates) (package private) void
Remap all ColumnReferences in this tree to be clones of the underlying expression.(package private) void
toString()
Convert this object to a String.Methods inherited from class org.apache.derby.impl.sql.compile.OrderedColumnList
getColumnOrdering
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNodeVector
acceptChildren, addElement, destructiveAppend, elementAt, indexOf, insertElementAt, iterator, nondestructiveAppend, printSubNodes, removeAllElements, removeElement, removeElementAt, setElementAt, size
Methods inherited from class org.apache.derby.impl.sql.compile.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, verifyClassExist
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.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:
toString
in classQueryTreeNode
- Returns:
- This object as a String
-
preprocess
void preprocess(int numTables, FromList fromList, SubqueryList whereSubquerys, PredicateList wherePredicates) throws StandardException - Throws:
StandardException
-