Package com.mckoi.database
Class QueryPlan.GroupNode
- java.lang.Object
-
- com.mckoi.database.QueryPlan.SingleQueryPlanNode
-
- com.mckoi.database.QueryPlan.GroupNode
-
- All Implemented Interfaces:
QueryPlanNode
,java.io.Serializable
,java.lang.Cloneable
- Enclosing class:
- QueryPlan
public static class QueryPlan.GroupNode extends QueryPlan.SingleQueryPlanNode
The node for performing a grouping operation on the columns of the child node. As well as grouping, any aggregate functions must also be defined with this plan.NOTE: The whole child is a group if columns is null.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private Variable[]
columns
The columns to group by.private Expression[]
function_list
Any aggregate functions (or regular function columns) that are to be planned.private Variable
group_max_column
The group max column.private java.lang.String[]
name_list
The list of names to give each function table.(package private) static long
serialVersionUID
-
Fields inherited from class com.mckoi.database.QueryPlan.SingleQueryPlanNode
child
-
-
Constructor Summary
Constructors Constructor Description GroupNode(QueryPlanNode child, Variable[] columns, Variable group_max_column, Expression[] function_list, java.lang.String[] name_list)
Groups over the given columns from the child.GroupNode(QueryPlanNode child, Variable group_max_column, Expression[] function_list, java.lang.String[] name_list)
Groups over the entire child (always ends in 1 result in set).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Deep clone.java.util.ArrayList
discoverCorrelatedVariables(int level, java.util.ArrayList list)
Default implementation that discovers correlated variables for the given offset level.java.util.ArrayList
discoverTableNames(java.util.ArrayList list)
Default implementation delegates responsibility to child.Table
evaluate(QueryContext context)
Evaluates the node and returns the result as a Table.java.lang.String
titleString()
-
Methods inherited from class com.mckoi.database.QueryPlan.SingleQueryPlanNode
child, debugString
-
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
columns
private Variable[] columns
The columns to group by.
-
group_max_column
private Variable group_max_column
The group max column.
-
function_list
private Expression[] function_list
Any aggregate functions (or regular function columns) that are to be planned.
-
name_list
private java.lang.String[] name_list
The list of names to give each function table.
-
-
Constructor Detail
-
GroupNode
public GroupNode(QueryPlanNode child, Variable[] columns, Variable group_max_column, Expression[] function_list, java.lang.String[] name_list)
Groups over the given columns from the child.
-
GroupNode
public GroupNode(QueryPlanNode child, Variable group_max_column, Expression[] function_list, java.lang.String[] name_list)
Groups over the entire child (always ends in 1 result in set).
-
-
Method Detail
-
evaluate
public Table evaluate(QueryContext context)
Description copied from interface:QueryPlanNode
Evaluates the node and returns the result as a Table. The VariableResolver resolves any outer variables
-
discoverTableNames
public java.util.ArrayList discoverTableNames(java.util.ArrayList list)
Description copied from class:QueryPlan.SingleQueryPlanNode
Default implementation delegates responsibility to child.- Specified by:
discoverTableNames
in interfaceQueryPlanNode
- Overrides:
discoverTableNames
in classQueryPlan.SingleQueryPlanNode
-
discoverCorrelatedVariables
public java.util.ArrayList discoverCorrelatedVariables(int level, java.util.ArrayList list)
Description copied from class:QueryPlan.SingleQueryPlanNode
Default implementation that discovers correlated variables for the given offset level.- Specified by:
discoverCorrelatedVariables
in interfaceQueryPlanNode
- Overrides:
discoverCorrelatedVariables
in classQueryPlan.SingleQueryPlanNode
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Description copied from class:QueryPlan.SingleQueryPlanNode
Deep clone.- Specified by:
clone
in interfaceQueryPlanNode
- Overrides:
clone
in classQueryPlan.SingleQueryPlanNode
- Throws:
java.lang.CloneNotSupportedException
-
titleString
public java.lang.String titleString()
- Overrides:
titleString
in classQueryPlan.SingleQueryPlanNode
-
-