class GroupedAggregateResultSet extends GenericAggregateResultSet implements CursorResultSet
BasicNoPutResultSetImpl.FieldComparator
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.util.List<java.util.Set<DataValueDescriptor>>> |
distinctValues |
private java.util.List<ExecRow> |
finishedResults |
private long |
genericSortId |
boolean |
hasDistinctAggregate |
boolean |
isInSortedOrder |
private int |
maxRowSize |
private int |
numDistinctAggs |
private ColumnOrdering[] |
order |
private ExecIndexRow[] |
resultRows |
private boolean |
resultsComplete |
private boolean |
rollup |
int |
rowsInput |
int |
rowsReturned |
private ScanController |
scanController |
java.util.Properties |
sortProperties |
private ExecIndexRow |
sortResultRow |
private ExecIndexRow |
sourceExecIndexRow |
private TransactionController |
tc |
private boolean |
usingAggregateObserver |
aggInfoList, aggregates, originalSource, source
checkNullCols, clonedExecRow, cncLen, resultSetNumber, targetResultSet
activation, beginTime, closeTime, compactRow, constructorTime, currentRow, endExecutionTime, finished, isOpen, isTopResultSet, nextTime, numOpens, openTime, optimizerEstimatedCost, optimizerEstimatedRowCount, resultDescription, rowsFiltered, rowsSeen, startExecutionTime, subqueryTrackingArray
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST
ABSOLUTE, FIRST, LAST, NEXT, PREVIOUS, RELATIVE, TEMPORARY_RESULT_SET_NUMBER
Constructor and Description |
---|
GroupedAggregateResultSet(NoPutResultSet s,
boolean isInSortedOrder,
int aggregateItem,
int orderingItem,
Activation a,
int ra,
int maxRowSize,
int resultSetNumber,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost,
boolean isRollup)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
close()
If the result set has been opened,
close the open scan.
|
void |
closeSource()
Close the source of whatever we have been scanning.
|
private ExecRow |
finalizeResults() |
ExecRow |
getCurrentRow()
This result set has its row from the last fetch done.
|
ExecRow |
getNextRowCore()
Return the next row.
|
private ExecIndexRow |
getNextRowFromRS()
Get the next output row for processing
|
private ExecIndexRow |
getRowFromResultSet()
Get a row from the input result set.
|
private ExecIndexRow |
getRowFromSorter()
Get a row from the sorter.
|
RowLocation |
getRowLocation()
This result set has its row location from
the last fetch done.
|
long |
getTimeSpent(int type)
Return the total amount of time spent in this ResultSet
|
private void |
initializeDistinctMaps(int r,
boolean allocate) |
private void |
initializeVectorAggregation(ExecRow row)
Run the aggregator initialization method for
each aggregator in the row.
|
private ScanController |
loadSorter()
Load up the sorter.
|
private ExecRow |
makeCurrent(java.lang.Object row) |
private void |
mergeVectorAggregates(ExecRow newRow,
ExecRow currRow,
int level)
Run the aggregator merge method for
each aggregator in the row.
|
private int |
numGCols()
Return the number of grouping columns.
|
void |
openCore()
Open the scan.
|
private int |
sameGroupingValues(ExecRow currRow,
ExecRow newRow)
Return whether or not the new row has the same values for the
grouping columns as the current row.
|
private void |
setRollupColumnsToNull(ExecRow row,
int resultNum) |
finish, finishAggregation, getRowTemplate, getSortAggregators, toXML
clearCurrentRow, clearOrderableCache, closeRowSource, getCursorName, getNextRowFromRowSource, getResultDescription, getValidColumns, isForUpdate, markRowAsDeleted, needsRowLocation, needsRowLocationForDeferredCheckConstraints, needsToClone, offendingRowLocation, positionScanAtRowLocation, printQualifiers, resultSetNumber, rowLocation, setCurrentRow, setHasDeferrableChecks, setNeedsRowLocation, setTargetResultSet, skipRow, skipScan, unpackHashValue, updateRow
addWarning, attachStatementContext, checkCancellationFlag, checkRowPosition, childrenToXML, cleanUp, dumpTimeStats, finishAndRTS, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCompactRow, getCurrentTimeMillis, getElapsedMillis, getEndExecutionTimestamp, getEstimatedRowCount, getExecuteTime, getExecutionFactory, getFirstRow, getLanguageConnectionContext, getLastRow, getNextRow, getPointOfAttachment, getPreviousRow, getRelativeRow, getRowNumber, getScanIsolationLevel, getSubqueryTrackingArray, getTransactionController, getWarnings, isClosed, isXplainOnlyMode, markAsTopResultSet, modifiedRowCount, open, recordConstructorTime, reopenCore, requiresRelocking, returnsRows, setAfterLastRow, setBeforeFirstRow, setCompactRow, setCompatRow, toXML
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addWarning, checkRowPosition, cleanUp, clearCurrentRow, finish, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCursorName, getEndExecutionTimestamp, getExecuteTime, getFirstRow, getLastRow, getNextRow, getPreviousRow, getRelativeRow, getResultDescription, getRowNumber, getSubqueryTrackingArray, getWarnings, isClosed, modifiedRowCount, open, returnsRows, setAfterLastRow, setBeforeFirstRow, toXML
public int rowsInput
public int rowsReturned
private ColumnOrdering[] order
public boolean hasDistinctAggregate
public boolean isInSortedOrder
private int numDistinctAggs
private int maxRowSize
private ScanController scanController
private ExecIndexRow sourceExecIndexRow
private ExecIndexRow sortResultRow
private boolean resultsComplete
private java.util.List<ExecRow> finishedResults
private ExecIndexRow[] resultRows
private java.util.List<java.util.List<java.util.Set<DataValueDescriptor>>> distinctValues
private boolean rollup
private boolean usingAggregateObserver
private long genericSortId
private TransactionController tc
public java.util.Properties sortProperties
GroupedAggregateResultSet(NoPutResultSet s, boolean isInSortedOrder, int aggregateItem, int orderingItem, Activation a, int ra, int maxRowSize, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost, boolean isRollup) throws StandardException
s
- input result setisInSortedOrder
- true if the source results are in sorted orderaggregateItem
- indicates the number of the
SavedObject off of the PreparedStatement that holds the
AggregatorInfoList used by this routine.orderingItem
- indicates the number of the
SavedObject off of the PreparedStatement that holds the
ColumOrdering array used by this routinea
- activationra
- saved object that builds an empty output rowmaxRowSize
- approx row size, passed to sorterresultSetNumber
- The resultSetNumber for this result setStandardException
- Thrown on errorpublic void openCore() throws StandardException
openCore
in interface NoPutResultSet
StandardException
- thrown if cursor finished.private ScanController loadSorter() throws StandardException
StandardException
- thrown on failure.private int numGCols()
public ExecRow getNextRowCore() throws StandardException
getNextRowCore
in interface NoPutResultSet
getNextRowCore
in class BasicNoPutResultSetImpl
StandardException
- thrown on failure.StandardException
- ResultSetNotOpen thrown if not yet open.NoPutResultSet.getNextRowCore()
private ExecRow makeCurrent(java.lang.Object row) throws StandardException
StandardException
private ExecRow finalizeResults() throws StandardException
StandardException
private int sameGroupingValues(ExecRow currRow, ExecRow newRow) throws StandardException
currRow
- The current row.newRow
- The new row.StandardException
- thrown on failure to get row locationpublic void close() throws StandardException
close
in interface ResultSet
close
in class NoPutResultSetImpl
StandardException
- thrown on errorpublic long getTimeSpent(int type)
getTimeSpent
in interface ResultSet
type
- CURRENT_RESULTSET_ONLY - time spent only in this ResultSet
ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.public RowLocation getRowLocation() throws StandardException
getRowLocation
in interface CursorResultSet
StandardException
- thrown on failure to get row locationCursorResultSet
public ExecRow getCurrentRow() throws StandardException
getCurrentRow
in interface CursorResultSet
StandardException
- thrown on failure.CursorResultSet
private ExecIndexRow getNextRowFromRS() throws StandardException
StandardException
private ExecIndexRow getRowFromResultSet() throws StandardException
StandardException
private void setRollupColumnsToNull(ExecRow row, int resultNum) throws StandardException
StandardException
private ExecIndexRow getRowFromSorter() throws StandardException
StandardException
public void closeSource() throws StandardException
StandardException
- thrown on errorprivate void initializeVectorAggregation(ExecRow row) throws StandardException
row
- the row to initializestandard
- Derby exceptionStandardException
private void mergeVectorAggregates(ExecRow newRow, ExecRow currRow, int level) throws StandardException
newRow
- the row to mergecurrRow
- the row to merge intostandard
- Derby exceptionStandardException
private void initializeDistinctMaps(int r, boolean allocate) throws StandardException
StandardException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.