Package org.apache.calcite.rel.core
Class JoinInfo
- java.lang.Object
-
- org.apache.calcite.rel.core.JoinInfo
-
- Direct Known Subclasses:
JoinInfo.EquiJoinInfo
,JoinInfo.NonEquiJoinInfo
public abstract class JoinInfo extends java.lang.Object
An analyzed join condition.It is useful for the many algorithms that care whether a join is an equi-join.
You can create one using
of(org.apache.calcite.rel.RelNode, org.apache.calcite.rel.RelNode, org.apache.calcite.rex.RexNode)
, or callJoin.analyzeCondition()
; many kinds of join cache their join info, especially those that are equi-joins and sub-classEquiJoin
.- See Also:
Join.analyzeCondition()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
JoinInfo.EquiJoinInfo
JoinInfo that represents an equi-join.private static class
JoinInfo.NonEquiJoinInfo
JoinInfo that represents a non equi-join.
-
Field Summary
Fields Modifier and Type Field Description ImmutableIntList
leftKeys
ImmutableIntList
rightKeys
-
Constructor Summary
Constructors Modifier Constructor Description protected
JoinInfo(ImmutableIntList leftKeys, ImmutableIntList rightKeys)
Creates a JoinInfo.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description RexNode
getEquiCondition(RelNode left, RelNode right, RexBuilder rexBuilder)
abstract RexNode
getRemaining(RexBuilder rexBuilder)
abstract boolean
isEqui()
Returns whether this is an equi-join.java.util.List<ImmutableIntList>
keys()
ImmutableBitSet
leftSet()
static JoinInfo
of(RelNode left, RelNode right, RexNode condition)
Creates aJoinInfo
by analyzing a condition.static JoinInfo
of(ImmutableIntList leftKeys, ImmutableIntList rightKeys)
Creates an equi-join.java.util.List<IntPair>
pairs()
Returns a list of (left, right) key ordinals.ImmutableBitSet
rightSet()
-
-
-
Field Detail
-
leftKeys
public final ImmutableIntList leftKeys
-
rightKeys
public final ImmutableIntList rightKeys
-
-
Constructor Detail
-
JoinInfo
protected JoinInfo(ImmutableIntList leftKeys, ImmutableIntList rightKeys)
Creates a JoinInfo.
-
-
Method Detail
-
of
public static JoinInfo of(RelNode left, RelNode right, RexNode condition)
Creates aJoinInfo
by analyzing a condition.
-
of
public static JoinInfo of(ImmutableIntList leftKeys, ImmutableIntList rightKeys)
Creates an equi-join.
-
isEqui
public abstract boolean isEqui()
Returns whether this is an equi-join.
-
pairs
public java.util.List<IntPair> pairs()
Returns a list of (left, right) key ordinals.
-
leftSet
public ImmutableBitSet leftSet()
-
rightSet
public ImmutableBitSet rightSet()
-
getRemaining
public abstract RexNode getRemaining(RexBuilder rexBuilder)
-
getEquiCondition
public RexNode getEquiCondition(RelNode left, RelNode right, RexBuilder rexBuilder)
-
keys
public java.util.List<ImmutableIntList> keys()
-
-