Class SemiJoin
- java.lang.Object
-
- org.apache.calcite.rel.AbstractRelNode
-
- org.apache.calcite.rel.BiRel
-
- org.apache.calcite.rel.core.Join
-
- org.apache.calcite.rel.core.EquiJoin
-
- org.apache.calcite.rel.core.SemiJoin
-
- All Implemented Interfaces:
java.lang.Cloneable
,RelOptNode
,RelNode
- Direct Known Subclasses:
EnumerableSemiJoin
public class SemiJoin extends EquiJoin
Relational expression that joins two relational expressions according to some condition, but outputs only columns from the left input, and eliminates duplicates.The effect is something like the SQL
IN
operator.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context
-
-
Field Summary
-
Fields inherited from class org.apache.calcite.rel.core.Join
condition, joinType, variablesSet
-
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet
-
-
Constructor Summary
Constructors Constructor Description SemiJoin(RelOptCluster cluster, RelTraitSet traitSet, RelNode left, RelNode right, RexNode condition, ImmutableIntList leftKeys, ImmutableIntList rightKeys)
Creates a SemiJoin.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RelOptCost
computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq)
Returns the cost of this plan (not including children).SemiJoin
copy(RelTraitSet traitSet, RexNode condition, RelNode left, RelNode right, JoinRelType joinType, boolean semiJoinDone)
Creates a copy of this join, overriding condition, system fields and inputs.static SemiJoin
create(RelNode left, RelNode right, RexNode condition, ImmutableIntList leftKeys, ImmutableIntList rightKeys)
Creates a SemiJoin.RelDataType
deriveRowType()
double
estimateRowCount(RelMetadataQuery mq)
Returns an estimate of the number of rows this relational expression will return.-
Methods inherited from class org.apache.calcite.rel.core.EquiJoin
analyzeCondition, getLeftKeys, getRightKeys
-
Methods inherited from class org.apache.calcite.rel.core.Join
accept, copy, createJoinType, deriveJoinRowType, estimateJoinedRows, explainTerms, getChildExps, getCondition, getJoinType, getSystemFieldList, getVariablesSet, isSemiJoinDone, isValid
-
Methods inherited from class org.apache.calcite.rel.BiRel
childrenAccept, getInputs, getLeft, getRight, replaceInput
-
Methods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, collectVariablesSet, collectVariablesUsed, computeDigest, computeSelfCost, explain, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getQuery, getRelTypeName, getRows, getRowType, getTable, getTraitSet, getVariablesStopped, isDistinct, isKey, isValid, metadata, onRegister, recomputeDigest, register, sole, toString
-
-
-
-
Constructor Detail
-
SemiJoin
public SemiJoin(RelOptCluster cluster, RelTraitSet traitSet, RelNode left, RelNode right, RexNode condition, ImmutableIntList leftKeys, ImmutableIntList rightKeys)
Creates a SemiJoin.Use
create(org.apache.calcite.rel.RelNode, org.apache.calcite.rel.RelNode, org.apache.calcite.rex.RexNode, org.apache.calcite.util.ImmutableIntList, org.apache.calcite.util.ImmutableIntList)
unless you know what you're doing.- Parameters:
cluster
- cluster that join belongs totraitSet
- Trait setleft
- left join inputright
- right join inputcondition
- join conditionleftKeys
- left keys of the semijoinrightKeys
- right keys of the semijoin
-
-
Method Detail
-
create
public static SemiJoin create(RelNode left, RelNode right, RexNode condition, ImmutableIntList leftKeys, ImmutableIntList rightKeys)
Creates a SemiJoin.
-
copy
public SemiJoin copy(RelTraitSet traitSet, RexNode condition, RelNode left, RelNode right, JoinRelType joinType, boolean semiJoinDone)
Description copied from class:Join
Creates a copy of this join, overriding condition, system fields and inputs.General contract as
RelNode.copy(org.apache.calcite.plan.RelTraitSet, java.util.List<org.apache.calcite.rel.RelNode>)
.
-
computeSelfCost
public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq)
Description copied from interface:RelNode
Returns the cost of this plan (not including children). The base implementation throws an error; derived classes should override.NOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getNonCumulativeCost(org.apache.calcite.rel.RelNode)
, which gives plugins a chance to override the rel's default ideas about cost.- Specified by:
computeSelfCost
in interfaceRelNode
- Overrides:
computeSelfCost
in classJoin
- Parameters:
planner
- Planner for cost calculationmq
- Metadata query- Returns:
- Cost of this plan (not including children)
-
estimateRowCount
public double estimateRowCount(RelMetadataQuery mq)
Description copied from interface:RelNode
Returns an estimate of the number of rows this relational expression will return.NOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getRowCount(org.apache.calcite.rel.RelNode)
, which gives plugins a chance to override the rel's default ideas about row count.- Specified by:
estimateRowCount
in interfaceRelNode
- Overrides:
estimateRowCount
in classJoin
- Parameters:
mq
- Metadata query- Returns:
- Estimate of the number of rows this relational expression will return
-
deriveRowType
public RelDataType deriveRowType()
In the case of semi-join, the row type consists of columns from left input only.
- Overrides:
deriveRowType
in classJoin
-
-