saffron.rel
Class Join

java.lang.Object
  |
  +--saffron.rel.Rel
        |
        +--saffron.rel.Join
Direct Known Subclasses:
Correlator, JavaNestedLoopJoin, PlanNestedLoopJoin

public class Join
extends Rel

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


Nested Class Summary
private static class Join.ConvertToJavaRule
           
private static class Join.ConvertToPlanRule
           
static class Join.JoinType
          Values are as JoinExpression.getJoinTypeCode(java.lang.String).
 
Nested classes inherited from class saffron.rel.Rel
 
Field Summary
protected  Expression condition
           
protected  int joinType
          Values must be of enumeration Join.JoinType, except that Join.JoinType.RIGHT is disallowed.
protected  Rel left
           
protected  Rel right
           
protected  Set variablesStopped
           
 
Fields inherited from class saffron.rel.Rel
cluster, digest, emptyArray, id, nextId, rowType
 
Constructor Summary
Join(Cluster cluster, Rel left, Rel right, Expression condition, int joinType, Set variablesStopped)
           
 
Method Summary
 void childrenAccept(RelVisitor visitor)
           
 Object clone()
           
protected  Type deriveRowType()
           
 void explain(PlanWriter pw)
           
 Expression[] getChildExps()
          Returns an array of this Rel's child expressions (not including the inputs returned by getInputs().
 Expression getCondition()
           
 Rel[] getInputs()
          Returns an array of this Rel's inputs.
 int getJoinType()
           
 Rel getLeft()
           
 Rel getRight()
           
 Set getVariablesStopped()
          Returns the names of variables which are set in this relational expression but also used and therefore not available to parents of this relational expression.
static void register(Planner planner)
          See Rel.register(saffron.Planner).
 void registerStoppedVariable(String name)
           
 void replaceInput(int ordinalInParent, Rel p)
          Replaces the ordinalInParentth input.
 void setVariablesStopped(HashSet set)
           
 int switchJoinType(int joinType)
           
 
Methods inherited from class saffron.rel.Rel
computeDigest, computeSelfCost, getCluster, getConvention, getCorelVariable, getEnvironment, getId, getInput, getOrCreateCorelVariable, getParentEnv, getQualifier, getQuery, getRelTypeName, getRows, getRowType, getTable, getType, implement, implementExp, implementExps, implementFieldAccess, implementSelf, isAccessTo, isDistinct, onRegister, recomputeDigest, registerCorelVariable, setCorelVariable, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

left

protected Rel left

right

protected Rel right

condition

protected Expression condition

variablesStopped

protected Set variablesStopped

joinType

protected int joinType
Values must be of enumeration Join.JoinType, except that Join.JoinType.RIGHT is disallowed.

Constructor Detail

Join

public Join(Cluster cluster,
            Rel left,
            Rel right,
            Expression condition,
            int joinType,
            Set variablesStopped)
Method Detail

clone

public Object clone()
Specified by:
clone in class Rel

getLeft

public Rel getLeft()

getRight

public Rel getRight()

getCondition

public Expression getCondition()

getJoinType

public int getJoinType()

getInputs

public Rel[] getInputs()
Description copied from class: Rel
Returns an array of this Rel's inputs. If there are no inputs, returns an empty array, not null.

Overrides:
getInputs in class Rel

getChildExps

public Expression[] getChildExps()
Description copied from class: Rel
Returns an array of this Rel's child expressions (not including the inputs returned by Rel.getInputs(). If there are no child expressions, returns an empty array, not null.

Overrides:
getChildExps in class Rel

replaceInput

public void replaceInput(int ordinalInParent,
                         Rel p)
Description copied from class: Rel
Replaces the ordinalInParentth input. You must override this method if you override Rel.getInputs().

Overrides:
replaceInput in class Rel

childrenAccept

public void childrenAccept(RelVisitor visitor)
Overrides:
childrenAccept in class Rel

deriveRowType

protected Type deriveRowType()
Specified by:
deriveRowType in class Rel

getVariablesStopped

public Set getVariablesStopped()
Description copied from class: Rel
Returns the names of variables which are set in this relational expression but also used and therefore not available to parents of this relational expression.

By default, returns the empty set. Derived classes may override this method.

Overrides:
getVariablesStopped in class Rel

setVariablesStopped

public void setVariablesStopped(HashSet set)

registerStoppedVariable

public void registerStoppedVariable(String name)

register

public static void register(Planner planner)
See Rel.register(saffron.Planner).


explain

public void explain(PlanWriter pw)
Overrides:
explain in class Rel

switchJoinType

public int switchJoinType(int joinType)

SourceForge.net_Logo