|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.runtime.CalcTupleIter org.eigenbase.runtime.NestedLoopCalcTupleIter
public abstract class NestedLoopCalcTupleIter
NestedLoopCalcTupleIter
is a specialization of CalcTupleIter
for use in implementing nested loop inner joins over
iterators.
REVIEW jvs 20-Mar-2004: I have parameterized this to handle inner and left outer joins, as well as one-to-many and many-to-one variants. This comes at the price of some efficiency. It would probably be better to write specialized bases for each purpose.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.eigenbase.runtime.TupleIter |
---|
TupleIter.NoDataReason, TupleIter.TimeoutException |
Field Summary | |
---|---|
private boolean |
isLeftOuter
|
private boolean |
isOpen
|
protected Object |
leftObj
|
private boolean |
needNullRow
|
protected Object |
rightIterator
|
protected Object |
rightObj
|
Fields inherited from class org.eigenbase.runtime.CalcTupleIter |
---|
inputIterator |
Fields inherited from interface org.eigenbase.runtime.TupleIter |
---|
EMPTY_ITERATOR |
Constructor Summary | |
---|---|
protected |
NestedLoopCalcTupleIter(TupleIter leftIterator,
boolean isLeftOuter)
|
Method Summary | |
---|---|
protected abstract Object |
calcJoinRow()
Method to be implemented by subclasses to either calculate the next joined row based on current values of leftObj and rightObj, or else to filter out this combination. |
protected Object |
calcRightNullRow()
Method to be implemented by subclasses to calculate a mismatch row in a left outer join. |
Object |
fetchNext()
Returns the next element in the iteration. |
protected abstract Object |
getNextRightIterator()
Method to be implemented by subclasses to determine next right-hand iterator based on current value of leftObj. |
protected void |
open()
Method which can be overridden by subclasses to carry out post-constructor initialization. |
Methods inherited from class org.eigenbase.runtime.CalcTupleIter |
---|
closeAllocation, restart, setTimeout |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Object rightIterator
protected Object leftObj
protected Object rightObj
private boolean isOpen
private boolean isLeftOuter
private boolean needNullRow
Constructor Detail |
---|
protected NestedLoopCalcTupleIter(TupleIter leftIterator, boolean isLeftOuter)
Method Detail |
---|
public Object fetchNext()
TupleIter
TupleIter.NoDataReason
enumeration indicating why
no data was returned.
If this method returns TupleIter.NoDataReason.END_OF_DATA
, no further
data will be returned by this iterator unless TupleIter.restart()
is called.
If this method returns TupleIter.NoDataReason.UNDERFLOW
, no data is
currently available, but may be come available in the future. It is
possible for consecutive calls to return UNDERFLOW and then END_OF_DATA.
The object returned by this method may be re-used for each subsequent
call to fetchNext()
. In other words, callers must either
make certain that the returned value is no longer needed or is copied
before any subsequent calls to fetchNext()
.
TupleIter.NoDataReason
.protected void open()
protected abstract Object getNextRightIterator()
TupleIter.EMPTY_ITERATOR
for a mismatch.
protected abstract Object calcJoinRow()
protected Object calcRightNullRow()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |