Class MergeJoinResultSet
java.lang.Object
org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
org.apache.derby.impl.sql.execute.NoPutResultSetImpl
org.apache.derby.impl.sql.execute.JoinResultSet
org.apache.derby.impl.sql.execute.MergeJoinResultSet
- All Implemented Interfaces:
CursorResultSet, NoPutResultSet, ResultSet, RowLocationRetRowSource, RowSource
Merge two result sets. The left result set (the outer
result set) MUST be unique for this to work correctly.
-
Nested Class Summary
Nested classes/interfaces inherited from class BasicNoPutResultSetImpl
BasicNoPutResultSetImpl.FieldComparator -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate GeneratedMethodprivate static final intFields inherited from class JoinResultSet
isRightOpen, leftNumCols, leftResultSet, leftRow, mergedRow, notExistsRightSide, oneRowRightSide, restriction, restrictionTime, rightNumCols, rightResultSet, rightRow, rowsReturned, rowsSeenLeft, rowsSeenRight, userSuppliedOptimizerOverridesFields inherited from class NoPutResultSetImpl
checkNullCols, clonedExecRow, cncLen, resultSetNumber, targetResultSetFields inherited from class BasicNoPutResultSetImpl
activation, beginTime, closeTime, compactRow, constructorTime, currentRow, endExecutionTime, finished, isOpen, isTopResultSet, nextTime, numOpens, openTime, optimizerEstimatedCost, optimizerEstimatedRowCount, resultDescription, rowsFiltered, rowsSeen, startExecutionTime, subqueryTrackingArrayFields inherited from interface NoPutResultSet
ABSOLUTE, FIRST, LAST, NEXT, PREVIOUS, RELATIVE, TEMPORARY_RESULT_SET_NUMBERFields inherited from interface ResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST -
Constructor Summary
ConstructorsConstructorDescriptionMergeJoinResultSet(NoPutResultSet leftResultSet, int leftNumCols, NoPutResultSet rightResultSet, int rightNumCols, Activation activation, GeneratedMethod leftGreaterThanRight, GeneratedMethod restriction, int resultSetNumber, boolean oneRowRightSide, boolean notExistsRightSide, double optimizerEstimatedRowCount, double optimizerEstimatedCost) Create a MergeJoinResultSet -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()If the result set has been opened, close the open scan.Return the requested values computed from the next row (if any) for which the restriction evaluates to true.private ExecRowgetReturnRow(ExecRow leftRow, ExecRow rightRow) ///////////////////////////////////////////////////////////////longgetTimeSpent(int type) Return the total amount of time spent in this ResultSetprivate booleanMethods inherited from class JoinResultSet
clearScanState, closeRight, finish, getCurrentRow, getRowLocation, openCore, openRight, reopenCoreMethods inherited from class NoPutResultSetImpl
clearCurrentRow, clearOrderableCache, closeRowSource, getCursorName, getNextRowFromRowSource, getResultDescription, getValidColumns, isForUpdate, markRowAsDeleted, needsRowLocation, needsRowLocationForDeferredCheckConstraints, needsToClone, offendingRowLocation, positionScanAtRowLocation, printQualifiers, resultSetNumber, rowLocation, setCurrentRow, setHasDeferrableChecks, setNeedsRowLocation, setTargetResultSet, skipRow, skipScan, unpackHashValue, updateRowMethods inherited from class BasicNoPutResultSetImpl
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, requiresRelocking, returnsRows, setAfterLastRow, setBeforeFirstRow, setCompactRow, setCompatRow, toXML, toXMLMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ResultSet
addWarning, checkRowPosition, cleanUp, clearCurrentRow, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCursorName, getEndExecutionTimestamp, getExecuteTime, getFirstRow, getLastRow, getNextRow, getPreviousRow, getRelativeRow, getResultDescription, getRowNumber, getSubqueryTrackingArray, getWarnings, isClosed, modifiedRowCount, open, returnsRows, setAfterLastRow, setBeforeFirstRow, toXML
-
Field Details
-
GREATER_THAN
private static final int GREATER_THAN- See Also:
-
EQUAL
private static final int EQUAL- See Also:
-
LESS_THAN
private static final int LESS_THAN- See Also:
-
leftGreaterThanRight
-
-
Constructor Details
-
MergeJoinResultSet
MergeJoinResultSet(NoPutResultSet leftResultSet, int leftNumCols, NoPutResultSet rightResultSet, int rightNumCols, Activation activation, GeneratedMethod leftGreaterThanRight, GeneratedMethod restriction, int resultSetNumber, boolean oneRowRightSide, boolean notExistsRightSide, double optimizerEstimatedRowCount, double optimizerEstimatedCost) Create a MergeJoinResultSet- Parameters:
leftResultSet- the left (outer) result setleftNumCols- columns in left rowrightResultSet- the right (outer) result setrightNumCols- columns in right rowactivation- activationleftGreaterThanRight- a generated method that is used to ascertain whether the row from the left result set is greater than the row from the right result set. returns 1,0,or -1 to indicate greater than, equal, or less than, respectivelyrestriction- generated method for additional qualificationresultSetNumber- the result set numberoneRowRightSide- ignoredoptimizerEstimatedRowCount- self-explanatoryoptimizerEstimatedCost- self-explanatory
-
-
Method Details
-
getNextRowCore
Return the requested values computed from the next row (if any) for which the restriction evaluates to true.restriction parameters are evaluated for each row.
- Specified by:
getNextRowCorein interfaceNoPutResultSet- Specified by:
getNextRowCorein classBasicNoPutResultSetImpl- Returns:
- the next row in the join result
- Throws:
StandardException- Thrown on errorStandardException- ResultSetNotOpen thrown if closed- See Also:
-
close
If the result set has been opened, close the open scan.- Specified by:
closein interfaceResultSet- Overrides:
closein classJoinResultSet- Throws:
StandardException- thrown on error
-
getTimeSpent
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 ResultSet ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.- Returns:
- long The total amount of time spent (in milliseconds).
-
getReturnRow
///////////////////////////////////////////////////////////////- Throws:
StandardException
-
restrictionIsTrue
- Throws:
StandardException
-