|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
org.apache.derby.impl.sql.execute.NoPutResultSetImpl
org.apache.derby.impl.sql.execute.GenericAggregateResultSet
org.apache.derby.impl.sql.execute.ScalarAggregateResultSet
class ScalarAggregateResultSet
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().
| Field Summary | |
|---|---|
protected int |
countOfRows
|
protected boolean |
isInSortedOrder
|
private boolean |
nextSatisfied
|
int |
rowsInput
|
boolean |
singleInputRow
|
protected ExecIndexRow |
sourceExecIndexRow
|
| Fields inherited from class org.apache.derby.impl.sql.execute.GenericAggregateResultSet |
|---|
aggInfoList, aggregates, originalSource, source |
| Fields inherited from class org.apache.derby.impl.sql.execute.NoPutResultSetImpl |
|---|
checkNullCols, clonedExecRow, cncLen, resultSetNumber, targetResultSet |
| Fields inherited from class org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl |
|---|
activation, beginTime, closeTime, compactRow, constructorTime, currentRow, endExecutionTime, finished, isOpen, isTopResultSet, nextTime, numOpens, openTime, optimizerEstimatedCost, optimizerEstimatedRowCount, resultDescription, rowsFiltered, rowsSeen, startExecutionTime, subqueryTrackingArray |
| Fields inherited from interface org.apache.derby.iapi.sql.ResultSet |
|---|
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST |
| Fields inherited from interface org.apache.derby.iapi.sql.execute.NoPutResultSet |
|---|
ABSOLUTE, FIRST, LAST, NEXT, PREVIOUS, RELATIVE |
| Constructor Summary | |
|---|---|
ScalarAggregateResultSet(NoPutResultSet s,
boolean isInSortedOrder,
int aggregateItem,
Activation a,
int ra,
int resultSetNumber,
boolean singleInputRow,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost)
Constructor |
|
| Method Summary | |
|---|---|
protected void |
accumulateScalarAggregation(ExecRow inputRow,
ExecRow accumulateRow,
boolean hasDistinctAggregates)
Run accumulation on every aggregate in this row. |
void |
close()
If the result set has been opened, close the open scan. |
ExecRow |
getCurrentRow()
This result set has its row from the last fetch done. |
ExecRow |
getNextRowCore()
Return the next row. |
ExecIndexRow |
getRowFromResultSet(boolean doClone)
Get a row from the input result set. |
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 |
initializeScalarAggregation(ExecRow row)
|
void |
openCore()
Open the scan. |
void |
reopenCore()
reopen a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values... |
| Methods inherited from class org.apache.derby.impl.sql.execute.GenericAggregateResultSet |
|---|
finish, finishAggregation, getRowTemplate, getSortAggregators |
| Methods inherited from class org.apache.derby.impl.sql.execute.NoPutResultSetImpl |
|---|
clearCurrentRow, clearOrderableCache, closeRowSource, getCursorName, getNextRowFromRowSource, getResultDescription, getValidColumns, isForUpdate, markRowAsDeleted, needsRowLocation, needsToClone, positionScanAtRowLocation, printQualifiers, resultSetNumber, rowLocation, setCurrentRow, setNeedsRowLocation, setTargetResultSet, skipRow, skipScan, updateRow |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.derby.iapi.sql.ResultSet |
|---|
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 |
| Field Detail |
|---|
public int rowsInput
public boolean singleInputRow
protected boolean isInSortedOrder
protected ExecIndexRow sourceExecIndexRow
private boolean nextSatisfied
protected int countOfRows
| Constructor Detail |
|---|
ScalarAggregateResultSet(NoPutResultSet s,
boolean isInSortedOrder,
int aggregateItem,
Activation a,
int ra,
int resultSetNumber,
boolean singleInputRow,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost)
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.a - activationra - saved object that builds an empty output rowresultSetNumber - The resultSetNumber for this result set
StandardException - Thrown on error| Method Detail |
|---|
public void openCore()
throws StandardException
openCore in interface NoPutResultSetStandardException - thrown if cursor finished.
public ExecRow getNextRowCore()
throws StandardException
getNextRowCore in interface NoPutResultSetgetNextRowCore in class BasicNoPutResultSetImplStandardException - thrown on failure.
StandardException - ResultSetNotOpen thrown if not yet open.NoPutResultSet.getNextRowCore()
public void close()
throws StandardException
close in interface ResultSetclose in class NoPutResultSetImplStandardException - thrown on errorpublic long getTimeSpent(int type)
getTimeSpent in interface ResultSettype - 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 CursorResultSetStandardException - thrown on failure to get row locationCursorResultSet
public ExecRow getCurrentRow()
throws StandardException
getCurrentRow in interface CursorResultSetStandardException - thrown on failure.CursorResultSet
public ExecIndexRow getRowFromResultSet(boolean doClone)
throws StandardException
doClone - - true of the row should be cloned
StandardException - Thrown on error
public void reopenCore()
throws StandardException
reopenCore in interface NoPutResultSetreopenCore in class BasicNoPutResultSetImplStandardException - thrown if cursor finished.NoPutResultSet.openCore()
protected void accumulateScalarAggregation(ExecRow inputRow,
ExecRow accumulateRow,
boolean hasDistinctAggregates)
throws StandardException
inputRow - the input rowaccumulateRow - the row with the accumulator (may be the same as the input row.hasDistinctAggregates - does this scan have distinct
aggregates. Used to figure out whether to merge
or accumulate nondistinct aggregates.
StandardException - Thrown on error
private void initializeScalarAggregation(ExecRow row)
throws StandardException
StandardException
|
Built on Wed 2013-06-12 15:21:56+0000, from revision ??? | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||