Package org.apache.calcite.rel.logical
Class LogicalJoin
- java.lang.Object
-
- org.apache.calcite.rel.AbstractRelNode
-
- org.apache.calcite.rel.BiRel
-
- org.apache.calcite.rel.core.Join
-
- org.apache.calcite.rel.logical.LogicalJoin
-
- All Implemented Interfaces:
java.lang.Cloneable
,RelOptNode
,RelNode
public final class LogicalJoin extends Join
Sub-class ofJoin
not targeted at any particular engine or calling convention.Some rules:
JoinExtractFilterRule
converts aninner join
to afilter
on top of acartesian inner join
.net.sf.farrago.fennel.rel.FennelCartesianJoinRule
implements a LogicalJoin as a cartesian product.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
semiJoinDone
private com.google.common.collect.ImmutableList<RelDataTypeField>
systemFieldList
-
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 LogicalJoin(RelOptCluster cluster, RelTraitSet traitSet, RelNode left, RelNode right, RexNode condition, java.util.Set<CorrelationId> variablesSet, JoinRelType joinType, boolean semiJoinDone, com.google.common.collect.ImmutableList<RelDataTypeField> systemFieldList)
Creates a LogicalJoin.LogicalJoin(RelOptCluster cluster, RelTraitSet traitSet, RelNode left, RelNode right, RexNode condition, JoinRelType joinType, java.util.Set<java.lang.String> variablesStopped, boolean semiJoinDone, com.google.common.collect.ImmutableList<RelDataTypeField> systemFieldList)
Deprecated.LogicalJoin(RelOptCluster cluster, RelNode left, RelNode right, RexNode condition, JoinRelType joinType, java.util.Set<java.lang.String> variablesStopped)
Deprecated.LogicalJoin(RelOptCluster cluster, RelNode left, RelNode right, RexNode condition, JoinRelType joinType, java.util.Set<java.lang.String> variablesStopped, boolean semiJoinDone, com.google.common.collect.ImmutableList<RelDataTypeField> systemFieldList)
Deprecated.LogicalJoin(RelInput input)
Creates a LogicalJoin by parsing serialized output.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description RelNode
accept(RelShuttle shuttle)
Accepts a visit from a shuttle.LogicalJoin
copy(RelTraitSet traitSet, RexNode conditionExpr, RelNode left, RelNode right, JoinRelType joinType, boolean semiJoinDone)
Creates a copy of this join, overriding condition, system fields and inputs.static LogicalJoin
create(RelNode left, RelNode right, RexNode condition, java.util.Set<CorrelationId> variablesSet, JoinRelType joinType)
Creates a LogicalJoin.static LogicalJoin
create(RelNode left, RelNode right, RexNode condition, java.util.Set<CorrelationId> variablesSet, JoinRelType joinType, boolean semiJoinDone, com.google.common.collect.ImmutableList<RelDataTypeField> systemFieldList)
Creates a LogicalJoin, flagged with whether it has been translated to a semi-join.static LogicalJoin
create(RelNode left, RelNode right, RexNode condition, JoinRelType joinType, java.util.Set<java.lang.String> variablesStopped)
Deprecated.static LogicalJoin
create(RelNode left, RelNode right, RexNode condition, JoinRelType joinType, java.util.Set<java.lang.String> variablesStopped, boolean semiJoinDone, com.google.common.collect.ImmutableList<RelDataTypeField> systemFieldList)
Deprecated.RelWriter
explainTerms(RelWriter pw)
Describes the inputs and attributes of this relational expression.java.util.List<RelDataTypeField>
getSystemFieldList()
Returns a list of system fields that will be prefixed to output row type.boolean
isSemiJoinDone()
Returns whether this LogicalJoin has already spawned aSemiJoin
viaJoinAddRedundantSemiJoinRule
.-
Methods inherited from class org.apache.calcite.rel.core.Join
accept, analyzeCondition, computeSelfCost, copy, createJoinType, deriveJoinRowType, deriveRowType, estimateJoinedRows, estimateRowCount, getChildExps, getCondition, getJoinType, getVariablesSet, isValid
-
Methods inherited from class org.apache.calcite.rel.BiRel
childrenAccept, getInputs, getLeft, getRight, replaceInput
-
Methods inherited from class org.apache.calcite.rel.AbstractRelNode
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
-
-
-
-
Field Detail
-
semiJoinDone
private final boolean semiJoinDone
-
systemFieldList
private final com.google.common.collect.ImmutableList<RelDataTypeField> systemFieldList
-
-
Constructor Detail
-
LogicalJoin
public LogicalJoin(RelOptCluster cluster, RelTraitSet traitSet, RelNode left, RelNode right, RexNode condition, java.util.Set<CorrelationId> variablesSet, JoinRelType joinType, boolean semiJoinDone, com.google.common.collect.ImmutableList<RelDataTypeField> systemFieldList)
Creates a LogicalJoin.Use
create(org.apache.calcite.rel.RelNode, org.apache.calcite.rel.RelNode, org.apache.calcite.rex.RexNode, java.util.Set<org.apache.calcite.rel.core.CorrelationId>, org.apache.calcite.rel.core.JoinRelType, boolean, com.google.common.collect.ImmutableList<org.apache.calcite.rel.type.RelDataTypeField>)
unless you know what you're doing.- Parameters:
cluster
- ClustertraitSet
- Trait setleft
- Left inputright
- Right inputcondition
- Join conditionjoinType
- Join typevariablesSet
- Set of variables that are set by the LHS and used by the RHS and are not available to nodes above this LogicalJoin in the treesemiJoinDone
- Whether this join has been translated to a semi-joinsystemFieldList
- List of system fields that will be prefixed to output row type; typically empty but must not be null- See Also:
isSemiJoinDone()
-
LogicalJoin
@Deprecated public LogicalJoin(RelOptCluster cluster, RelTraitSet traitSet, RelNode left, RelNode right, RexNode condition, JoinRelType joinType, java.util.Set<java.lang.String> variablesStopped, boolean semiJoinDone, com.google.common.collect.ImmutableList<RelDataTypeField> systemFieldList)
Deprecated.
-
LogicalJoin
@Deprecated public LogicalJoin(RelOptCluster cluster, RelNode left, RelNode right, RexNode condition, JoinRelType joinType, java.util.Set<java.lang.String> variablesStopped)
Deprecated.
-
LogicalJoin
@Deprecated public LogicalJoin(RelOptCluster cluster, RelNode left, RelNode right, RexNode condition, JoinRelType joinType, java.util.Set<java.lang.String> variablesStopped, boolean semiJoinDone, com.google.common.collect.ImmutableList<RelDataTypeField> systemFieldList)
Deprecated.
-
LogicalJoin
public LogicalJoin(RelInput input)
Creates a LogicalJoin by parsing serialized output.
-
-
Method Detail
-
create
public static LogicalJoin create(RelNode left, RelNode right, RexNode condition, java.util.Set<CorrelationId> variablesSet, JoinRelType joinType, boolean semiJoinDone, com.google.common.collect.ImmutableList<RelDataTypeField> systemFieldList)
Creates a LogicalJoin, flagged with whether it has been translated to a semi-join.
-
create
@Deprecated public static LogicalJoin create(RelNode left, RelNode right, RexNode condition, JoinRelType joinType, java.util.Set<java.lang.String> variablesStopped, boolean semiJoinDone, com.google.common.collect.ImmutableList<RelDataTypeField> systemFieldList)
Deprecated.
-
create
public static LogicalJoin create(RelNode left, RelNode right, RexNode condition, java.util.Set<CorrelationId> variablesSet, JoinRelType joinType)
Creates a LogicalJoin.
-
create
@Deprecated public static LogicalJoin create(RelNode left, RelNode right, RexNode condition, JoinRelType joinType, java.util.Set<java.lang.String> variablesStopped)
Deprecated.
-
copy
public LogicalJoin copy(RelTraitSet traitSet, RexNode conditionExpr, 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>)
.
-
accept
public RelNode accept(RelShuttle shuttle)
Description copied from interface:RelNode
Accepts a visit from a shuttle.- Specified by:
accept
in interfaceRelNode
- Overrides:
accept
in classAbstractRelNode
- Parameters:
shuttle
- Shuttle- Returns:
- A copy of this node incorporating changes made by the shuttle to this node's children
-
explainTerms
public RelWriter explainTerms(RelWriter pw)
Description copied from class:AbstractRelNode
Describes the inputs and attributes of this relational expression. Each node should callsuper.explainTerms
, then call theRelWriterImpl.input(String, RelNode)
andRelWriterImpl.item(String, Object)
methods for each input and attribute.- Overrides:
explainTerms
in classJoin
- Parameters:
pw
- Plan writer- Returns:
- Plan writer for fluent-explain pattern
-
isSemiJoinDone
public boolean isSemiJoinDone()
Description copied from class:Join
Returns whether this LogicalJoin has already spawned aSemiJoin
viaJoinAddRedundantSemiJoinRule
.The base implementation returns false.
- Overrides:
isSemiJoinDone
in classJoin
- Returns:
- whether this join has already spawned a semi join
-
getSystemFieldList
public java.util.List<RelDataTypeField> getSystemFieldList()
Description copied from class:Join
Returns a list of system fields that will be prefixed to output row type.- Overrides:
getSystemFieldList
in classJoin
- Returns:
- list of system fields
-
-