org.eigenbase.rel
Class JoinRel

java.lang.Object
  extended by org.eigenbase.rel.AbstractRelNode
      extended by org.eigenbase.rel.JoinRelBase
          extended by org.eigenbase.rel.JoinRel
All Implemented Interfaces:
Cloneable, RelNode

public final class JoinRel
extends JoinRelBase

A JoinRel represents two relational expressions joined according to some condition.

Some rules:

Version:
$Id: //open/dev/farrago/src/org/eigenbase/rel/JoinRel.java#27 $
Author:
jhyde

Field Summary
private  boolean semiJoinDone
           
private  List<RelDataTypeField> systemFieldList
           
 
Fields inherited from class org.eigenbase.rel.JoinRelBase
condition, joinType, left, right, variablesStopped
 
Fields inherited from class org.eigenbase.rel.AbstractRelNode
digest, id, nextId, rowType, traits
 
Fields inherited from interface org.eigenbase.rel.RelNode
emptyArray
 
Constructor Summary
JoinRel(RelOptCluster cluster, RelNode left, RelNode right, RexNode condition, JoinRelType joinType, Set<String> variablesStopped)
          Creates a JoinRel.
JoinRel(RelOptCluster cluster, RelNode left, RelNode right, RexNode condition, JoinRelType joinType, Set<String> variablesStopped, boolean semiJoinDone, List<RelDataTypeField> systemFieldList)
          Creates a JoinRel, flagged with whether it has been translated to a semi-join.
 
Method Summary
 JoinRel clone()
          Clones this RelNode.
 void explain(RelOptPlanWriter pw)
           
 List<RelDataTypeField> getSystemFieldList()
          Returns a list of system fields that will be prefixed to output row type.
 boolean isSemiJoinDone()
          Returns whether this JoinRel has already spawned a SemiJoinRel via AddRedundantSemiJoinRule.
 
Methods inherited from class org.eigenbase.rel.JoinRelBase
_isValid, childrenAccept, computeSelfCost, createJoinType, deriveJoinRowType, deriveRowType, estimateJoinedRows, getChildExps, getCondition, getInputs, getJoinType, getLeft, getRight, getRows, getVariablesStopped, registerStoppedVariable, replaceInput, setVariablesStopped
 
Methods inherited from class org.eigenbase.rel.AbstractRelNode
cloneTraits, collectVariablesSet, collectVariablesUsed, computeDigest, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getOrCreateCorrelVariable, getQuery, getRelTypeName, getRowType, getTable, getTraits, inheritTraitsFrom, isAccessTo, isDistinct, isValid, onRegister, recomputeDigest, register, registerCorrelVariable, setCorrelVariable, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

semiJoinDone

private final boolean semiJoinDone

systemFieldList

private List<RelDataTypeField> systemFieldList
Constructor Detail

JoinRel

public JoinRel(RelOptCluster cluster,
               RelNode left,
               RelNode right,
               RexNode condition,
               JoinRelType joinType,
               Set<String> variablesStopped)
Creates a JoinRel.

Parameters:
cluster - Cluster
left - Left input
right - Right input
condition - Join condition
joinType - Join type
variablesStopped - Set of names of variables which are set by the LHS and used by the RHS and are not available to nodes above this JoinRel in the tree

JoinRel

public JoinRel(RelOptCluster cluster,
               RelNode left,
               RelNode right,
               RexNode condition,
               JoinRelType joinType,
               Set<String> variablesStopped,
               boolean semiJoinDone,
               List<RelDataTypeField> systemFieldList)
Creates a JoinRel, flagged with whether it has been translated to a semi-join.

Parameters:
cluster - Cluster
left - Left input
right - Right input
condition - Join condition
joinType - Join type
variablesStopped - Set of names of variables which are set by the LHS and used by the RHS and are not available to nodes above this JoinRel in the tree
semiJoinDone - Whether this join has been translated to a semi-join
systemFieldList - List of system fields that will be prefixed to output row type; typically empty but must not be null
See Also:
isSemiJoinDone()
Method Detail

clone

public JoinRel clone()
Description copied from interface: RelNode
Clones this RelNode.

Traits of the RelNode must be explicitly cloned, using AbstractRelNode.inheritTraitsFrom(AbstractRelNode), as the RelNode may have traits of which it has no knowledge. Example implementation:

     public MyRelNode clone()
     {
         MyRelNode clone = new MyRelNode(...);
         clone.inheritTraitsFrom(this);
         return clone;
     }
 
N.B.: This method must be overridden whenever an existing, concrete RelNode is extended. Otherwise, calling clone() will produce a differently typed RelNode, resulting in invalid or incorrect query plans.

Specified by:
clone in interface RelNode
Specified by:
clone in class AbstractRelNode
Returns:
a clone of this RelNode

explain

public void explain(RelOptPlanWriter pw)
Specified by:
explain in interface RelNode
Overrides:
explain in class JoinRelBase

isSemiJoinDone

public boolean isSemiJoinDone()
Returns whether this JoinRel has already spawned a SemiJoinRel via AddRedundantSemiJoinRule.

Returns:
whether this join has already spawned a semi join

getSystemFieldList

public List<RelDataTypeField> getSystemFieldList()
Description copied from class: JoinRelBase
Returns a list of system fields that will be prefixed to output row type.

Overrides:
getSystemFieldList in class JoinRelBase
Returns:
list of system fields