java.lang.Object
org.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.QueryTreeNodeVector
org.apache.derby.impl.sql.compile.OrderedColumnList
org.apache.derby.impl.sql.compile.GroupByList
- All Implemented Interfaces:
- org.apache.derby.iapi.sql.compile.Visitable
- public class GroupByList
- extends OrderedColumnList
A GroupByList represents the list of expressions in a GROUP BY clause in
a SELECT statement.
| Methods inherited from class org.apache.derby.impl.sql.compile.OrderedColumnList |
accept, addElement, destructiveAppend, elementAt, getColumnOrdering, indexOf, insertElementAt, nondestructiveAppend, remove, removeAllElements, removeElement, removeElementAt, setElementAt, size |
| Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
bind, convertDefaultNode, debugFlush, debugPrint, executeSchemaName, executeStatementName, formatNodeString, foundString, generate, generate, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContextManager, getCursorInfo, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getNodeFactory, getNodeType, getNullNode, getParameterTypes, getRowEstimate, getSchemaDescriptor, getSchemaDescriptor, getSPSName, getStatementType, getTableDescriptor, getTypeCompiler, init, init, init, init, init, init, init, init, init, init, init, init, init, init, isAtomic, isInstanceOf, isSessionSchema, isSessionSchema, makeConstantAction, makeResultDescription, makeTableName, needsSavepoint, nodeHeader, optimize, parseQueryText, printLabel, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setContextManager, setEndOffset, setNodeType, setRefActionInfo, treePrint, treePrint, verifyClassExist |
numGroupingColsAdded
int numGroupingColsAdded
GroupByList
public GroupByList()
addGroupByColumn
public void addGroupByColumn(GroupByColumn column)
- Add a column to the list
getGroupByColumn
public GroupByColumn getGroupByColumn(int position)
- Get a column from the list
printSubNodes
public void printSubNodes(int depth)
- Print the list.
- Overrides:
printSubNodes in class QueryTreeNode
getNumNeedToAddGroupingCols
public int getNumNeedToAddGroupingCols()
- Get the number of grouping columns that need to be added to the SELECT list.
bindGroupByColumns
public void bindGroupByColumns(SelectNode select,
java.util.Vector aggregateVector)
throws org.apache.derby.iapi.error.StandardException
- 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.
verifyUniqueGroupingColumns
public void verifyUniqueGroupingColumns()
throws org.apache.derby.iapi.error.StandardException
- Check the uniqueness of the column names within a GROUP BY list.
addNewGroupingColumnsToRCL
public void addNewGroupingColumnsToRCL(SelectNode selectNode)
throws org.apache.derby.iapi.error.StandardException
- Add any grouping columns which are not already in the appropriate RCL
to the RCL.
NOTE: The RC/VCNs in the SELECT list will point to the same pool of
ResultColumns as the GroupByColumns in this list.
containsColumnReference
public GroupByColumn containsColumnReference(ColumnReference cr)
remapColumnReferencesToExpressions
public void remapColumnReferencesToExpressions()
throws org.apache.derby.iapi.error.StandardException
- Remap all ColumnReferences in this tree to be clones of the
underlying expression.
toString
public java.lang.String toString()
- Print it out, baby
- Overrides:
toString in class QueryTreeNodeVector