com.metamatrix.query.processor.relational
Class MergeJoinStrategy

java.lang.Object
  extended by com.metamatrix.query.processor.relational.JoinStrategy
      extended by com.metamatrix.query.processor.relational.MergeJoinStrategy
Direct Known Subclasses:
NestedLoopJoinStrategy, PartitionedSortJoin

public class MergeJoinStrategy
extends JoinStrategy

MergeJoinStrategy supports generalized Full, Left Outer, and Inner Joins (containing non-equi join criteria) as long as there is at least one equi-join criteria Additionally supports Semi and Anti-Semi Joins. These too allow for generalized non-equi join criteria. TODO: when there is no non-equi join criteria matching duplicates from the outer side can be output immediately TODO: semi joins should only output left tuples Support for Intersect and Except is controlled by the grouping flag, which changes comparisons to check for null equality.


Nested Class Summary
static class MergeJoinStrategy.SortOption
           
 
Field Summary
protected  MergeJoinStrategy.SortOption processingSortLeft
           
protected  MergeJoinStrategy.SortOption processingSortRight
           
protected  MergeJoinStrategy.SortOption sortLeft
           
protected  MergeJoinStrategy.SortOption sortRight
           
 
Fields inherited from class com.metamatrix.query.processor.relational.JoinStrategy
joinNode, leftSource, rightSource
 
Constructor Summary
MergeJoinStrategy(MergeJoinStrategy.SortOption sortLeft, MergeJoinStrategy.SortOption sortRight, boolean grouping)
           
 
Method Summary
 java.lang.Object clone()
           
 void close()
           
protected  int compare(java.util.List leftProbe, java.util.List rightProbe, int[] leftExpressionIndecies, int[] rightExpressionIndecies)
           
protected  boolean compareToPrevious(com.metamatrix.query.processor.relational.SourceState target)
           
 java.lang.String getName()
           
 void initialize(JoinNode joinNode)
           
protected  void loadLeft()
           
protected  java.util.List nextTuple()
           
protected  void postLoadLeft()
           
protected  void postLoadRight()
           
 void setProcessingSortRight(boolean processingSortRight)
           
protected  void sortRight()
           
 java.lang.String toString()
           
 
Methods inherited from class com.metamatrix.query.processor.relational.JoinStrategy
loadRight, outputTuple
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sortLeft

protected MergeJoinStrategy.SortOption sortLeft

sortRight

protected MergeJoinStrategy.SortOption sortRight

processingSortLeft

protected MergeJoinStrategy.SortOption processingSortLeft

processingSortRight

protected MergeJoinStrategy.SortOption processingSortRight
Constructor Detail

MergeJoinStrategy

public MergeJoinStrategy(MergeJoinStrategy.SortOption sortLeft,
                         MergeJoinStrategy.SortOption sortRight,
                         boolean grouping)
Method Detail

clone

public java.lang.Object clone()
Specified by:
clone in class JoinStrategy
See Also:
JoinStrategy.clone()

initialize

public void initialize(JoinNode joinNode)
                throws MetaMatrixComponentException
Overrides:
initialize in class JoinStrategy
Throws:
MetaMatrixComponentException
See Also:
JoinStrategy.initialize(com.metamatrix.query.processor.relational.JoinNode)

close

public void close()
           throws TupleSourceNotFoundException,
                  MetaMatrixComponentException
Overrides:
close in class JoinStrategy
Throws:
TupleSourceNotFoundException
MetaMatrixComponentException
See Also:
JoinStrategy.close()

nextTuple

protected java.util.List nextTuple()
                            throws MetaMatrixComponentException,
                                   CriteriaEvaluationException,
                                   MetaMatrixProcessingException
Specified by:
nextTuple in class JoinStrategy
Throws:
MetaMatrixComponentException
CriteriaEvaluationException
MetaMatrixProcessingException

compareToPrevious

protected boolean compareToPrevious(com.metamatrix.query.processor.relational.SourceState target)
                             throws MetaMatrixComponentException,
                                    MetaMatrixProcessingException
Throws:
MetaMatrixComponentException
MetaMatrixProcessingException

compare

protected int compare(java.util.List leftProbe,
                      java.util.List rightProbe,
                      int[] leftExpressionIndecies,
                      int[] rightExpressionIndecies)

loadLeft

protected void loadLeft()
                 throws MetaMatrixComponentException,
                        MetaMatrixProcessingException
Overrides:
loadLeft in class JoinStrategy
Throws:
MetaMatrixComponentException
MetaMatrixProcessingException
See Also:
JoinStrategy.loadLeft()

postLoadLeft

protected void postLoadLeft()
                     throws MetaMatrixComponentException,
                            MetaMatrixProcessingException
Overrides:
postLoadLeft in class JoinStrategy
Throws:
MetaMatrixComponentException
MetaMatrixProcessingException

postLoadRight

protected void postLoadRight()
                      throws MetaMatrixComponentException,
                             MetaMatrixProcessingException
Overrides:
postLoadRight in class JoinStrategy
Throws:
MetaMatrixComponentException
MetaMatrixProcessingException

sortRight

protected void sortRight()
                  throws MetaMatrixComponentException,
                         TupleSourceNotFoundException,
                         BlockedOnMemoryException
Throws:
MetaMatrixComponentException
TupleSourceNotFoundException
BlockedOnMemoryException

setProcessingSortRight

public void setProcessingSortRight(boolean processingSortRight)

getName

public java.lang.String getName()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2009. All Rights Reserved.