This ResultSet evaluates scalar, non distinct aggregates.
It will scan the entire source result set and calculate
the scalar aggregates when scanning the source during the
first call to next().
author: jerry (broken out from SortResultSet)
ScalarAggregateResultSet(NoPutResultSet s, boolean isInSortedOrder, int aggregateItem, Activation a, GeneratedMethod ra, int resultSetNumber, boolean singleInputRow, double optimizerEstimatedRowCount, double optimizerEstimatedCost) Constructor
Parameters: s - input result set Parameters: isInSortedOrder - true if the source results are in sorted order Parameters: aggregateItem - indicates the number of theSavedObject off of the PreparedStatement that holds theAggregatorInfoList used by this routine.
getRowLocation() This result set has its row location from
the last fetch done.
public long
getTimeSpent(int type) Return the total amount of time spent in this ResultSet
Parameters: type - CURRENT_RESULTSET_ONLY - time spent only in this ResultSetENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.
ScalarAggregateResultSet(NoPutResultSet s, boolean isInSortedOrder, int aggregateItem, Activation a, GeneratedMethod ra, int resultSetNumber, boolean singleInputRow, double optimizerEstimatedRowCount, double optimizerEstimatedCost) throws StandardException(Code)
Constructor
Parameters: s - input result set Parameters: isInSortedOrder - true if the source results are in sorted order Parameters: aggregateItem - indicates the number of theSavedObject off of the PreparedStatement that holds theAggregatorInfoList used by this routine. Parameters: a - activation Parameters: ra - generated method to build an emptyoutput row Parameters: resultSetNumber - The resultSetNumber for this result set exception: StandardException - Thrown on error
Run accumulation on every aggregate in this
row. This method is useful when draining the source
or sorter, depending on whether or not there were any
distinct aggregates. Remember, if there are distinct
aggregates, then the non-distinct aggregates were
calculated on the way into the sorter and only the
distinct aggregates will be accumulated here.
Otherwise, all aggregates will be accumulated here.
Parameters: inputRow - the input row Parameters: accumulateRow - the row with the accumulator (may be the same as the input row. Parameters: hasDistinctAggregates - does this scan have distinctaggregates. Used to figure out whether to mergeor accumulate nondistinct aggregates. exception: StandardException - Thrown on error
This result set has its row from the last fetch done.
If the cursor is closed, a null is returned.
See Also:CursorResultSet the last row returned; exception: StandardException - thrown on failure.
Return the next row. If it is a scalar aggregate scan
exception: StandardException - thrown on failure. exception: StandardException - ResultSetNotOpen thrown if not yet open. the next row in the result
This result set has its row location from
the last fetch done. Always returns null.
See Also:CursorResultSet the row location of the current cursor row. exception: StandardException - thrown on failure to get row location
Return the total amount of time spent in this ResultSet
Parameters: type - CURRENT_RESULTSET_ONLY - time spent only in this ResultSetENTIRE_RESULTSET_TREE - time spent in this ResultSet and below. long The total amount of time spent (in milliseconds).
reopen a scan on the table. scan parameters are evaluated
at each open, so there is probably some way of altering
their values...
exception: StandardException - thrown if cursor finished.
Fields inherited from org.apache.derby.impl.sql.execute.GenericAggregateResultSet