|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eigenbase.rel.AbstractRelNode
org.eigenbase.rel.JoinRelBase
public abstract class JoinRelBase
JoinRelBase is an abstract base class for implementations of
JoinRel.
| Field Summary | |
|---|---|
protected RexNode |
condition
|
protected JoinRelType |
joinType
Values must be of enumeration JoinRelType, except that JoinRelType.RIGHT is disallowed. |
protected RelNode |
left
|
protected RelNode |
right
|
protected Set<String> |
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 | |
|---|---|
protected |
JoinRelBase(RelOptCluster cluster,
RelTraitSet traits,
RelNode left,
RelNode right,
RexNode condition,
JoinRelType joinType,
Set<String> variablesStopped)
Creates a JoinRelBase. |
| Method Summary | |
|---|---|
boolean |
_isValid(boolean fail)
|
private static void |
addFields(List<RelDataTypeField> fieldList,
List<RelDataType> typeList,
List<String> nameList,
HashSet<String> uniqueNameList)
|
void |
childrenAccept(RelVisitor visitor)
Interacts with the RelVisitor in a visitor pattern to traverse
the tree of relational expressions. |
RelOptCost |
computeSelfCost(RelOptPlanner planner)
Returns the cost of this plan (not including children). |
static RelDataType |
createJoinType(RelDataTypeFactory typeFactory,
RelDataType leftType,
RelDataType rightType,
List<String> fieldNameList,
List<RelDataTypeField> systemFieldList)
Returns the type the row which results when two relations are joined. |
static RelDataType |
deriveJoinRowType(RelDataType leftType,
RelDataType rightType,
JoinRelType joinType,
RelDataTypeFactory typeFactory,
List<String> fieldNameList,
List<RelDataTypeField> systemFieldList)
Derives the type of a join relational expression. |
protected RelDataType |
deriveRowType()
|
static double |
estimateJoinedRows(JoinRelBase joinRel,
RexNode condition)
|
void |
explain(RelOptPlanWriter pw)
|
RexNode[] |
getChildExps()
Returns an array of this relational expression's child expressions (not including the inputs returned by RelNode.getInputs(). |
RexNode |
getCondition()
|
RelNode[] |
getInputs()
Returns an array of this relational expression's inputs. |
JoinRelType |
getJoinType()
|
RelNode |
getLeft()
|
RelNode |
getRight()
|
double |
getRows()
Returns an estimate of the number of rows this relational expression will return. |
List<RelDataTypeField> |
getSystemFieldList()
Returns a list of system fields that will be prefixed to output row type. |
Set<String> |
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,
RelNode p)
Replaces the ordinalInParentth input. |
void |
setVariablesStopped(Set<String> set)
|
| Methods inherited from class org.eigenbase.rel.AbstractRelNode |
|---|
clone, 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 |
|---|
protected RexNode condition
protected RelNode left
protected RelNode right
protected Set<String> variablesStopped
protected JoinRelType joinType
JoinRelType, except that JoinRelType.RIGHT is disallowed.
| Constructor Detail |
|---|
protected JoinRelBase(RelOptCluster cluster,
RelTraitSet traits,
RelNode left,
RelNode right,
RexNode condition,
JoinRelType joinType,
Set<String> variablesStopped)
cluster - Clustertraits - Traitsleft - Left inputright - Right inputcondition - Join conditionjoinType - Join typevariablesStopped - 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| Method Detail |
|---|
public RexNode[] getChildExps()
RelNodeRelNode.getInputs(). If there are no
child expressions, returns an empty array, not null.
getChildExps in interface RelNodegetChildExps in class AbstractRelNodepublic RexNode getCondition()
public RelNode[] getInputs()
RelNodenull.
getInputs in interface RelNodegetInputs in class AbstractRelNodepublic JoinRelType getJoinType()
public RelNode getLeft()
public RelNode getRight()
public boolean _isValid(boolean fail)
public RelOptCost computeSelfCost(RelOptPlanner planner)
RelNodeNOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getNonCumulativeCost(org.eigenbase.rel.RelNode), which gives plugins a
chance to override the rel's default ideas about cost.
computeSelfCost in interface RelNodecomputeSelfCost in class AbstractRelNode
public static double estimateJoinedRows(JoinRelBase joinRel,
RexNode condition)
public double getRows()
RelNodeNOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getRowCount(org.eigenbase.rel.RelNode), which gives plugins a chance to
override the rel's default ideas about row count.
getRows in interface RelNodegetRows in class AbstractRelNodepublic void setVariablesStopped(Set<String> set)
public Set<String> getVariablesStopped()
RelNodeBy default, returns the empty set. Derived classes may override this method.
getVariablesStopped in interface RelNodegetVariablesStopped in class AbstractRelNodepublic void childrenAccept(RelVisitor visitor)
RelNodeRelVisitor in a visitor pattern to traverse
the tree of relational expressions.
childrenAccept in interface RelNodechildrenAccept in class AbstractRelNodepublic void explain(RelOptPlanWriter pw)
explain in interface RelNodeexplain in class AbstractRelNodepublic void registerStoppedVariable(String name)
public void replaceInput(int ordinalInParent,
RelNode p)
RelNodeordinalInParentth input. You must
override this method if you override RelNode.getInputs().
replaceInput in interface RelNodereplaceInput in class AbstractRelNodeprotected RelDataType deriveRowType()
deriveRowType in class AbstractRelNodepublic List<RelDataTypeField> getSystemFieldList()
public static RelDataType deriveJoinRowType(RelDataType leftType,
RelDataType rightType,
JoinRelType joinType,
RelDataTypeFactory typeFactory,
List<String> fieldNameList,
List<RelDataTypeField> systemFieldList)
leftType - Row type of left input to joinrightType - Row type of right input to joinjoinType - Type of jointypeFactory - Type factoryfieldNameList - List of names of fields; if null, field names are
inherited and made uniquesystemFieldList - List of system fields that will be prefixed to
output row type; typically empty but must not be null
public static RelDataType createJoinType(RelDataTypeFactory typeFactory,
RelDataType leftType,
RelDataType rightType,
List<String> fieldNameList,
List<RelDataTypeField> systemFieldList)
The resulting row type consists of the system fields (if any), followed by the fields of the left type, followed by the fields of the right type. The field name list, if present, overrides the original names of the fields.
typeFactory - Type factoryleftType - Type of left input to joinrightType - Type of right input to joinfieldNameList - If not null, overrides the original names of the
fieldssystemFieldList - List of system fields that will be prefixed to
output row type; typically empty but must not be null
private static void addFields(List<RelDataTypeField> fieldList,
List<RelDataType> typeList,
List<String> nameList,
HashSet<String> uniqueNameList)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||