|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 ordinalInParent th 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 treeMethod Detail |
---|
public RexNode[] getChildExps()
RelNode
RelNode.getInputs()
. If there are no
child expressions, returns an empty array, not null
.
getChildExps
in interface RelNode
getChildExps
in class AbstractRelNode
public RexNode getCondition()
public RelNode[] getInputs()
RelNode
null
.
getInputs
in interface RelNode
getInputs
in class AbstractRelNode
public JoinRelType getJoinType()
public RelNode getLeft()
public RelNode getRight()
public boolean _isValid(boolean fail)
public RelOptCost computeSelfCost(RelOptPlanner planner)
RelNode
NOTE 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 RelNode
computeSelfCost
in class AbstractRelNode
public static double estimateJoinedRows(JoinRelBase joinRel, RexNode condition)
public double getRows()
RelNode
NOTE 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 RelNode
getRows
in class AbstractRelNode
public void setVariablesStopped(Set<String> set)
public Set<String> getVariablesStopped()
RelNode
By default, returns the empty set. Derived classes may override this method.
getVariablesStopped
in interface RelNode
getVariablesStopped
in class AbstractRelNode
public void childrenAccept(RelVisitor visitor)
RelNode
RelVisitor
in a visitor pattern
to traverse
the tree of relational expressions.
childrenAccept
in interface RelNode
childrenAccept
in class AbstractRelNode
public void explain(RelOptPlanWriter pw)
explain
in interface RelNode
explain
in class AbstractRelNode
public void registerStoppedVariable(String name)
public void replaceInput(int ordinalInParent, RelNode p)
RelNode
ordinalInParent
th input. You must
override this method if you override RelNode.getInputs()
.
replaceInput
in interface RelNode
replaceInput
in class AbstractRelNode
protected RelDataType deriveRowType()
deriveRowType
in class AbstractRelNode
public 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 |