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 | Class and Description |
|---|---|
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Object[] | currentGroupByExprData
The array of current group-by expression data e.g. AggregateData. |
| pack-priv int | currentGroupRowId
The id of the current group. |
| pack-priv final ArrayList | expressions
The query's column list, including invisible expressions such as order by expressions. |
| private final HashMap | exprToIndexInGroupByData
Maps an expression object to an index, to use in accessing the Object[] pointed to by groupByData. |
| pack-priv final SessionLocal | session
The database session. |
| private final HashMap | windowData
Maps an window expression object to its data. |
| private final HashMap | windowPartitionData
Maps an partitioned window expression object to its data. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final Object[] | Returns: new object array to holds group-by data.Creates new object arrays to holds group-by data. |
| public void | |
| public final Object | Returns: expression data or nullexpression expr)Get the group-by data for the current group and the passed in expression. |
| public int | |
| public static SelectGroups | Returns: new instance of the grouped data.the session session, ArrayList<Expression> the expressions expressions, boolean is this query is a group query isGroupQuery, int[] the indexes of group expressions, or null groupIndex)Creates new instance of grouped data. |
| public final PartitionData | Returns: expression data or nullexpression expr, Value a key of partition partitionKey)Get the window data for the specified expression. |
| public boolean | Returns: true if there is currently a group-by active,
otherwise returns false.Is there currently a group-by active. |
| public abstract ValueRow | |
| public void | |
| public void | |
| public abstract void | nextSource()
Invoked for each source row to evaluate group key and setup all necessary data for aggregates. |
| public void | |
| public void | |
| public void | |
| public final void | setCurrentGroupExprData(Expression
expression expr, Object expression data to set obj)Set the group-by data for the current group and the passed in expression. |
| public final void | setWindowExprData(DataAnalysisOperation
expression expr, Value a key of partition partitionKey, PartitionData window expression data to set obj)Set the window data for the specified expression. |
| pack-priv abstract void |
| currentGroupByExprData | back to summary |
|---|---|
| pack-priv Object[] currentGroupByExprData The array of current group-by expression data e.g. AggregateData. | |
| currentGroupRowId | back to summary |
|---|---|
| pack-priv int currentGroupRowId The id of the current group. | |
| expressions | back to summary |
|---|---|
| pack-priv final ArrayList<Expression> expressions The query's column list, including invisible expressions such as order by expressions. | |
| exprToIndexInGroupByData | back to summary |
|---|---|
| private final HashMap<Expression, Integer> exprToIndexInGroupByData Maps an expression object to an index, to use in accessing the Object[] pointed to by groupByData. | |
| session | back to summary |
|---|---|
| pack-priv final SessionLocal session The database session. | |
| windowData | back to summary |
|---|---|
| private final HashMap<DataAnalysisOperation, PartitionData> windowData Maps an window expression object to its data. | |
| windowPartitionData | back to summary |
|---|---|
| private final HashMap<DataAnalysisOperation, TreeMap<Value, PartitionData>> windowPartitionData Maps an partitioned window expression object to its data. | |
| SelectGroups | back to summary |
|---|---|
| pack-priv SelectGroups(SessionLocal session, ArrayList<Expression> expressions) | |
| createRow | back to summary |
|---|---|
| pack-priv final Object[] createRow() Creates new object arrays to holds group-by data.
| |
| done | back to summary |
|---|---|
| public void done() Invoked after all source rows are evaluated. | |
| getCurrentGroupExprData | back to summary |
|---|---|
| public final Object getCurrentGroupExprData(Expression expr) Get the group-by data for the current group and the passed in expression.
| |
| getCurrentGroupRowId | back to summary |
|---|---|
| public int getCurrentGroupRowId() Returns identity of the current row. Used by aggregates to check whether they already processed this row or not.
| |
| getInstance | back to summary |
|---|---|
| public static SelectGroups getInstance(SessionLocal session, ArrayList<Expression> expressions, boolean isGroupQuery, int[] groupIndex) Creates new instance of grouped data.
| |
| getWindowExprData | back to summary |
|---|---|
| public final PartitionData getWindowExprData(DataAnalysisOperation expr, Value partitionKey) Get the window data for the specified expression.
| |
| isCurrentGroup | back to summary |
|---|---|
| public boolean isCurrentGroup() Is there currently a group-by active.
| |
| next | back to summary |
|---|---|
| public abstract ValueRow next() Returns the key of the next group.
| |
| nextLazyGroup | back to summary |
|---|---|
| public void nextLazyGroup() Moves group data to the next group in lazy mode. | |
| nextLazyRow | back to summary |
|---|---|
| public void nextLazyRow() Moves group data to the next row in lazy mode. | |
| nextSource | back to summary |
|---|---|
| public abstract void nextSource() Invoked for each source row to evaluate group key and setup all necessary data for aggregates. | |
| remove | back to summary |
|---|---|
| public void remove() Removes the data for the current key.
| |
| reset | back to summary |
|---|---|
| public void reset() Resets this group data for reuse. | |
| resetLazy | back to summary |
|---|---|
| public void resetLazy() Resets this group data for reuse in lazy mode. | |
| setCurrentGroupExprData | back to summary |
|---|---|
| public final void setCurrentGroupExprData(Expression expr, Object obj) Set the group-by data for the current group and the passed in expression.
| |
| setWindowExprData | back to summary |
|---|---|
| public final void setWindowExprData(DataAnalysisOperation expr, Value partitionKey, PartitionData obj) Set the window data for the specified expression.
| |
| updateCurrentGroupExprData | back to summary |
|---|---|
| pack-priv abstract void updateCurrentGroupExprData() Update group-by data specified by implementation. | |
| Modifier and Type | Field and Description |
|---|---|
| private ValueRow | currentGroupsKey
Key into groupByData that produces currentGroupByExprData. |
| private Iterator | |
| private TreeMap | groupByData
Map of group-by key to group-by expression data e.g. AggregateData |
| private final int[] |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | done()
Overrides org. Invoked after all source rows are evaluated. |
| public ValueRow | next()
Implements abstract org. Returns the key of the next group. |
| public void | nextSource()
Implements abstract org. Invoked for each source row to evaluate group key and setup all necessary data for aggregates. |
| public void | |
| public void | |
| public void | resetLazy()
Overrides org. Resets this group data for reuse in lazy mode. |
| pack-priv void | updateCurrentGroupExprData()
Implements abstract org. Update group-by data specified by implementation. |
| currentGroupsKey | back to summary |
|---|---|
| private ValueRow currentGroupsKey Key into groupByData that produces currentGroupByExprData. Not used in lazy mode. | |
| cursor | back to summary |
|---|---|
| private Iterator<Map. Cursor for | |
| groupByData | back to summary |
|---|---|
| private TreeMap<ValueRow, Object[]> groupByData Map of group-by key to group-by expression data e.g. AggregateData | |
| groupIndex | back to summary |
|---|---|
| private final int[] groupIndex | |
| Grouped | back to summary |
|---|---|
| pack-priv Grouped(SessionLocal session, ArrayList<Expression> expressions, int[] groupIndex) | |
| done | back to summary |
|---|---|
| public void done() Overrides org. Doc from org. Invoked after all source rows are evaluated.
| |
| next | back to summary |
|---|---|
| public ValueRow next() Implements abstract org. Doc from org. Returns the key of the next group. | |
| nextSource | back to summary |
|---|---|
| public void nextSource() Implements abstract org. Doc from org. Invoked for each source row to evaluate group key and setup all necessary data for aggregates.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides org. Doc from org. Removes the data for the current key.
| |
| reset | back to summary |
|---|---|
| public void reset() Overrides org. Doc from org. Resets this group data for reuse.
| |
| resetLazy | back to summary |
|---|---|
| public void resetLazy() Overrides org. Doc from org. Resets this group data for reuse in lazy mode.
| |
| updateCurrentGroupExprData | back to summary |
|---|---|
| pack-priv void updateCurrentGroupExprData() Implements abstract org. Doc from org. Update group-by data specified by implementation.
| |
| Modifier and Type | Field and Description |
|---|---|
| private Iterator | |
| private ArrayList |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | done()
Overrides org. Invoked after all source rows are evaluated. |
| public ValueRow | next()
Implements abstract org. Returns the key of the next group. |
| public void | nextSource()
Implements abstract org. Invoked for each source row to evaluate group key and setup all necessary data for aggregates. |
| public void | |
| pack-priv void | updateCurrentGroupExprData()
Implements abstract org. Update group-by data specified by implementation. |
| cursor | back to summary |
|---|---|
| private Iterator<Object[]> cursor Cursor for | |
| rows | back to summary |
|---|---|
| private ArrayList<Object[]> rows | |
| Plain | back to summary |
|---|---|
| pack-priv Plain(SessionLocal session, ArrayList<Expression> expressions) | |
| done | back to summary |
|---|---|
| public void done() Overrides org. Doc from org. Invoked after all source rows are evaluated.
| |
| next | back to summary |
|---|---|
| public ValueRow next() Implements abstract org. Doc from org. Returns the key of the next group. | |
| nextSource | back to summary |
|---|---|
| public void nextSource() Implements abstract org. Doc from org. Invoked for each source row to evaluate group key and setup all necessary data for aggregates.
| |
| reset | back to summary |
|---|---|
| public void reset() Overrides org. Doc from org. Resets this group data for reuse.
| |
| updateCurrentGroupExprData | back to summary |
|---|---|
| pack-priv void updateCurrentGroupExprData() Implements abstract org. Doc from org. Update group-by data specified by implementation.
| |