Top Description Fields Constructors Methods
org.apache.derby.impl.sql.compile

pack-priv Class GroupByList

extends OrderedColumnList<GroupByColumn>
Class Inheritance
Imports
java.util.List, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.Limits, .SQLState, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.shared.common.sanity.SanityManager

A GroupByList represents the list of expressions in a GROUP BY clause in a SELECT statement.

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv void
addGroupByColumn(GroupByColumn
The column to add to the list
column
)

Add a column to the list

pack-priv void
bindGroupByColumns(SelectNode
The SelectNode
select
,
List<AggregateNode>
The aggregate list being built as we find AggregateNodes
aggregates
)

Bind the group by list.

pack-priv GroupByColumn

Returns:

the matching GroupByColumn if one exists, null otherwise.
findGroupingColumn
(ValueNode
an expression for which we are trying to find a match in the group by list.
node
)

Find the matching grouping column if any for the given expression

pack-priv GroupByColumn
getGroupByColumn(int
The column to get from the list
position
)

Get a column from the list

pack-priv int

Returns:

int The number of grouping columns that need to be added to the SELECT list.
getNumNeedToAddGroupingCols
()

Get the number of grouping columns that need to be added to the SELECT list.

pack-priv boolean
pack-priv void
preprocess(int numTables, FromList fromList, SubqueryList whereSubquerys, PredicateList wherePredicates)

pack-priv void
remapColumnReferencesToExpressions()

Remap all ColumnReferences in this tree to be clones of the underlying expression.

pack-priv void
public String

Returns:

This object as a String
toString
()

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.toString.

Convert this object to a String.

Inherited from org.apache.derby.impl.sql.compile.OrderedColumnList:
getColumnOrdering

Field Detail

numGroupingColsAddedback to summary
pack-priv int numGroupingColsAdded
rollupback to summary
pack-priv boolean rollup

Constructor Detail

GroupByListback to summary
public GroupByList(ContextManager cm)

Method Detail

addGroupByColumnback to summary
pack-priv void addGroupByColumn(GroupByColumn column)

Add a column to the list

Parameters
column:GroupByColumn

The column to add to the list

bindGroupByColumnsback to summary
pack-priv void bindGroupByColumns(SelectNode select, List<AggregateNode> aggregates) throws 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.

Parameters
select:SelectNode

The SelectNode

aggregates:List<AggregateNode>

The aggregate list being built as we find AggregateNodes

Exceptions
StandardException:
Thrown on error
findGroupingColumnback to summary
pack-priv GroupByColumn findGroupingColumn(ValueNode node) throws StandardException

Find the matching grouping column if any for the given expression

Parameters
node:ValueNode

an expression for which we are trying to find a match in the group by list.

Returns:GroupByColumn

the matching GroupByColumn if one exists, null otherwise.

getGroupByColumnback to summary
pack-priv GroupByColumn getGroupByColumn(int position)

Get a column from the list

Parameters
position:int

The column to get from the list

getNumNeedToAddGroupingColsback to summary
pack-priv int getNumNeedToAddGroupingCols()

Get the number of grouping columns that need to be added to the SELECT list.

Returns:int

int The number of grouping columns that need to be added to the SELECT list.

isRollupback to summary
pack-priv boolean isRollup()
preprocessback to summary
pack-priv void preprocess(int numTables, FromList fromList, SubqueryList whereSubquerys, PredicateList wherePredicates) throws StandardException
remapColumnReferencesToExpressionsback to summary
pack-priv void remapColumnReferencesToExpressions() throws StandardException

Remap all ColumnReferences in this tree to be clones of the underlying expression.

Exceptions
StandardException:
Thrown on error
setRollupback to summary
pack-priv void setRollup()
toStringback to summary
public String toString()

Overrides org.apache.derby.impl.sql.compile.QueryTreeNode.toString.

Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.

Returns:String

This object as a String

Annotations
@Override