Class JoinResultSet
java.lang.Object
org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
org.apache.derby.impl.sql.execute.NoPutResultSetImpl
org.apache.derby.impl.sql.execute.JoinResultSet
- All Implemented Interfaces:
CursorResultSet, NoPutResultSet, ResultSet, RowLocationRetRowSource, RowSource
- Direct Known Subclasses:
MergeJoinResultSet, NestedLoopJoinResultSet
Takes 2 NoPutResultSets and a join filter and returns
the join's rows satisfying the filter as a result set.
-
Nested Class Summary
Nested classes/interfaces inherited from class BasicNoPutResultSetImpl
BasicNoPutResultSetImpl.FieldComparator -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected intprotected ExecRowprotected ExecRowbooleanbooleanprotected GeneratedMethodlongprotected intprotected ExecRowintintint(package private) StringFields 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
ConstructorsConstructorDescriptionJoinResultSet(NoPutResultSet leftResultSet, int leftNumCols, NoPutResultSet rightResultSet, int rightNumCols, Activation activation, GeneratedMethod restriction, int resultSetNumber, boolean oneRowRightSide, boolean notExistsRightSide, double optimizerEstimatedRowCount, double optimizerEstimatedCost, String userSuppliedOptimizerOverrides) -
Method Summary
Modifier and TypeMethodDescription(package private) voidClear any private state that changes during scans.voidclose()If the result set has been opened, close the open scan.protected voidclose the rightResultSetvoidfinish()Tells the system that there will be no more access to any database information via this result set; in particular, no more calls to open().A join is combining rows from two sources, so it should never be used in a positioned update or delete.A join is combining rows from two sources, so it has no single row location to return; just return a null.voidopenCore()open a scan on the join.protected voidopen the rightResultSet.voidreopen a a join.Methods 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, getNextRowCore, 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, getTimeSpent, getWarnings, isClosed, modifiedRowCount, open, returnsRows, setAfterLastRow, setBeforeFirstRow, toXML
-
Field Details
-
rowsSeenLeft
public int rowsSeenLeft -
rowsSeenRight
public int rowsSeenRight -
rowsReturned
public int rowsReturned -
restrictionTime
public long restrictionTime -
isRightOpen
protected boolean isRightOpen -
leftRow
-
rightRow
-
mergedRow
-
leftResultSet
-
leftNumCols
protected int leftNumCols -
rightResultSet
-
rightNumCols
protected int rightNumCols -
restriction
-
oneRowRightSide
public boolean oneRowRightSide -
notExistsRightSide
public boolean notExistsRightSide -
userSuppliedOptimizerOverrides
String userSuppliedOptimizerOverrides
-
-
Constructor Details
-
JoinResultSet
JoinResultSet(NoPutResultSet leftResultSet, int leftNumCols, NoPutResultSet rightResultSet, int rightNumCols, Activation activation, GeneratedMethod restriction, int resultSetNumber, boolean oneRowRightSide, boolean notExistsRightSide, double optimizerEstimatedRowCount, double optimizerEstimatedCost, String userSuppliedOptimizerOverrides)
-
-
Method Details
-
clearScanState
void clearScanState()Clear any private state that changes during scans. This includes things like the last row seen, etc. THis does not include immutable things that are typically set up in the constructor.This method is called on open()/close() and reopen()
-
openCore
open a scan on the join. For a join, this means: o Open the left ResultSet o Do a getNextRow() on the left ResultSet to establish a position and get "parameter values" for the right ResultSet. NOTE: It is possible for the getNextRow() to return null, in which case there is no need to open the RightResultSet. We must remember this condition. o If the getNextRow() on the left ResultSet succeeded, then open() the right ResultSet. scan parameters are evaluated at each open, so there is probably some way of altering their values...- Specified by:
openCorein interfaceNoPutResultSet- Throws:
StandardException- Thrown on error
-
reopenCore
reopen a a join.- Specified by:
reopenCorein interfaceNoPutResultSet- Overrides:
reopenCorein classBasicNoPutResultSetImpl- Throws:
StandardException- thrown if cursor finished.- See Also:
-
close
If the result set has been opened, close the open scan.WARNING does not track close time, since it is expected to be called directly by its subclasses, and we don't want to skew the times - Specified by:
closein interfaceResultSet- Overrides:
closein classNoPutResultSetImpl- Throws:
StandardException- thrown on error
-
finish
Description copied from interface:ResultSetTells the system that there will be no more access to any database information via this result set; in particular, no more calls to open(). Will close the result set if it is not already closed.- Specified by:
finishin interfaceResultSet- Overrides:
finishin classBasicNoPutResultSetImpl- Throws:
StandardException- on error
-
getRowLocation
A join is combining rows from two sources, so it has no single row location to return; just return a null.- Specified by:
getRowLocationin interfaceCursorResultSet- Returns:
- the row location of the current cursor row.
- See Also:
-
getCurrentRow
A join is combining rows from two sources, so it should never be used in a positioned update or delete.- Specified by:
getCurrentRowin interfaceCursorResultSet- Returns:
- a null value.
- See Also:
-
openRight
open the rightResultSet. If already open, just reopen.- Throws:
StandardException- Thrown on error
-
closeRight
close the rightResultSet- Throws:
StandardException
-