public abstract class SelectGroups
extends java.lang.Object
Call sequence:
reset().nextSource() should be invoked.done().next() is invoked inside a loop until it returns null.Call sequence for lazy group sorted result:
resetLazy() (not required before the first execution).nextLazyGroup() should be invoked.nextLazyRow() should be invoked. Each group
can have one or more rows.| Modifier and Type | Method and Description |
|---|---|
void |
done()
Invoked after all source rows are evaluated.
|
java.util.ArrayList<Expression> |
expressions()
Gets the query's column list, including invisible expressions
such as order by expressions.
|
java.lang.Object |
getCurrentGroupExprData(Expression expr)
Get the group-by data for the current group and the passed in expression.
|
int |
getCurrentGroupRowId()
Returns identity of the current row.
|
static SelectGroups |
getInstance(Session session,
java.util.ArrayList<Expression> expressions,
boolean isGroupQuery,
int[] groupIndex)
Creates new instance of grouped data.
|
PartitionData |
getWindowExprData(DataAnalysisOperation expr,
Value partitionKey)
Get the window data for the specified expression.
|
boolean |
isCurrentGroup()
Is there currently a group-by active.
|
abstract ValueRow |
next()
Returns the key of the next group.
|
void |
nextLazyGroup()
Moves group data to the next group in lazy mode.
|
void |
nextLazyRow()
Moves group data to the next row in lazy mode.
|
abstract void |
nextSource()
Invoked for each source row to evaluate group key and setup all necessary
data for aggregates.
|
void |
remove()
Removes the data for the current key.
|
void |
reset()
Resets this group data for reuse.
|
void |
resetLazy()
Resets this group data for reuse in lazy mode.
|
void |
setCurrentGroupExprData(Expression expr,
java.lang.Object obj)
Set the group-by data for the current group and the passed in expression.
|
void |
setWindowExprData(DataAnalysisOperation expr,
Value partitionKey,
PartitionData obj)
Set the window data for the specified expression.
|
public static SelectGroups getInstance(Session session, java.util.ArrayList<Expression> expressions, boolean isGroupQuery, int[] groupIndex)
session - the sessionexpressions - the expressionsisGroupQuery - is this query is a group querygroupIndex - the indexes of group expressions, or nullpublic boolean isCurrentGroup()
true if there is currently a group-by active,
otherwise returns false.public final java.lang.Object getCurrentGroupExprData(Expression expr)
expr - expressionpublic final void setCurrentGroupExprData(Expression expr, java.lang.Object obj)
expr - expressionobj - expression data to setpublic final PartitionData getWindowExprData(DataAnalysisOperation expr, Value partitionKey)
expr - expressionpartitionKey - a key of partitionpublic final void setWindowExprData(DataAnalysisOperation expr, Value partitionKey, PartitionData obj)
expr - expressionpartitionKey - a key of partitionobj - window expression data to setpublic int getCurrentGroupRowId()
public void reset()
public abstract void nextSource()
public void done()
public abstract ValueRow next()
public void remove()
next()public void resetLazy()
public void nextLazyGroup()
public void nextLazyRow()
public java.util.ArrayList<Expression> expressions()