|
|||||||||
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 |
sortTemplateRow
|
protected ExecIndexRow |
sourceExecIndexRow
|
Fields inherited from class org.apache.derby.impl.sql.execute.GenericAggregateResultSet |
---|
aggInfoList, aggregates, originalSource, rowAllocator, 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,
GeneratedMethod 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, 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 |
---|
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 ExecIndexRow sortTemplateRow
protected boolean isInSortedOrder
protected ExecIndexRow sourceExecIndexRow
private boolean nextSatisfied
protected int countOfRows
Constructor Detail |
---|
ScalarAggregateResultSet(NoPutResultSet s, boolean isInSortedOrder, int aggregateItem, Activation a, GeneratedMethod 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
- generated method to build an empty
output rowresultSetNumber
- The resultSetNumber for this result set
StandardException
- Thrown on errorMethod Detail |
---|
public void openCore() throws StandardException
openCore
in interface NoPutResultSet
StandardException
- thrown if cursor finished.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()
public 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
public ExecIndexRow getRowFromResultSet(boolean doClone) throws StandardException
doClone
- - true of the row should be cloned
StandardException
- Thrown on errorpublic void reopenCore() throws StandardException
reopenCore
in interface NoPutResultSet
reopenCore
in class BasicNoPutResultSetImpl
StandardException
- 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 errorprivate void initializeScalarAggregation(ExecRow row) throws StandardException
StandardException
|
Built on Thu 2012-03-29 21:53:33+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |