net.sf.saffron.rel
Class JoinRel

java.lang.Object
  |
  +--net.sf.saffron.rel.SaffronRel
        |
        +--net.sf.saffron.rel.JoinRel
Direct Known Subclasses:
CorrelatorRel, JavaNestedLoopJoinRel

public class JoinRel
extends SaffronRel

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


Nested Class Summary
static class JoinRel.JoinType
          Enumeration of join types.
 
Field Summary
protected  RexNode condition
           
protected  int joinType
          Values must be of enumeration JoinRel.JoinType, except that JoinRel.JoinType.RIGHT is disallowed.
protected  SaffronRel left
           
protected  SaffronRel right
           
protected  Set variablesStopped
           
 
Fields inherited from class net.sf.saffron.rel.SaffronRel
cluster, digest, emptyArray, id, nextId, rowType
 
Constructor Summary
JoinRel(VolcanoCluster cluster, SaffronRel left, SaffronRel right, RexNode condition, int joinType, Set variablesStopped)
           
 
Method Summary
private static void addFields(SaffronType type, ArrayList typeList, ArrayList nameList)
           
 void childrenAccept(RelVisitor visitor)
           
 Object clone()
           
private  SaffronType createJoinType(SaffronType leftType, SaffronType rightType)
           
protected  SaffronType deriveRowType()
           
 void explain(PlanWriter pw)
           
 RexNode[] getChildExps()
          Returns an array of this SaffronRel's child expressions (not including the inputs returned by getInputs().
 RexNode getCondition()
           
 SaffronRel[] getInputs()
          Returns an array of this SaffronRel's inputs.
 int getJoinType()
           
 SaffronRel getLeft()
           
 SaffronRel 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.
 void registerStoppedVariable(String name)
           
 void replaceInput(int ordinalInParent, SaffronRel p)
          Replaces the ordinalInParentth input.
 void setVariablesStopped(HashSet set)
           
 int switchJoinType(int joinType)
           
 
Methods inherited from class net.sf.saffron.rel.SaffronRel
computeDigest, computeSelfCost, getCluster, getConvention, getCorrelVariable, getId, getInput, getOrCreateCorrelVariable, getQualifier, getQuery, getRelTypeName, getRows, getRowType, getTable, implement, implementFieldAccess, isAccessTo, isDistinct, onRegister, recomputeDigest, register, registerCorrelVariable, setCorrelVariable, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

condition

protected RexNode condition

left

protected SaffronRel left

right

protected SaffronRel right

variablesStopped

protected Set variablesStopped

joinType

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

Constructor Detail

JoinRel

public JoinRel(VolcanoCluster cluster,
               SaffronRel left,
               SaffronRel right,
               RexNode condition,
               int joinType,
               Set variablesStopped)
Method Detail

getChildExps

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

Overrides:
getChildExps in class SaffronRel

getCondition

public RexNode getCondition()

getInputs

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

Overrides:
getInputs in class SaffronRel

getJoinType

public int getJoinType()

getLeft

public SaffronRel getLeft()

getRight

public SaffronRel getRight()

setVariablesStopped

public void setVariablesStopped(HashSet set)

getVariablesStopped

public Set getVariablesStopped()
Description copied from class: SaffronRel
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 SaffronRel

childrenAccept

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

clone

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

explain

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

registerStoppedVariable

public void registerStoppedVariable(String name)

replaceInput

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

Overrides:
replaceInput in class SaffronRel

switchJoinType

public int switchJoinType(int joinType)

deriveRowType

protected SaffronType deriveRowType()
Specified by:
deriveRowType in class SaffronRel

createJoinType

private SaffronType createJoinType(SaffronType leftType,
                                   SaffronType rightType)

addFields

private static void addFields(SaffronType type,
                              ArrayList typeList,
                              ArrayList nameList)

SourceForge.net_Logo