Class RexTableInputRef
- java.lang.Object
-
- org.apache.calcite.rex.RexNode
-
- org.apache.calcite.rex.RexVariable
-
- org.apache.calcite.rex.RexSlot
-
- org.apache.calcite.rex.RexInputRef
-
- org.apache.calcite.rex.RexTableInputRef
-
public class RexTableInputRef extends RexInputRef
Variable which references a column of a table occurrence in a relational plan.This object is used by
BuiltInMetadata.ExpressionLineage
andBuiltInMetadata.AllPredicates
.Given a relational expression, its purpose is to be able to reference uniquely the provenance of a given expression. For that, it uses a unique table reference (contained in a
RexTableInputRef.RelTableRef
) and an column index within the table.For example,
A.#0.$3 + 2
column$3
in the0
occurrence of tableA
in the plan.Note that this kind of
RexNode
is an auxiliary data structure with a very specific purpose and should not be used in relational expressions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RexTableInputRef.RelTableRef
Identifies uniquely a table by its qualified name and its entity number (occurrence)-
Nested classes/interfaces inherited from class org.apache.calcite.rex.RexSlot
RexSlot.SelfPopulatingList
-
-
Field Summary
Fields Modifier and Type Field Description private RexTableInputRef.RelTableRef
tableRef
-
Fields inherited from class org.apache.calcite.rex.RexVariable
name, type
-
-
Constructor Summary
Constructors Modifier Constructor Description private
RexTableInputRef(RexTableInputRef.RelTableRef tableRef, int index, RelDataType type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <R,P>
Raccept(RexBiVisitor<R,P> visitor, P arg)
Accepts a visitor with a payload, dispatching to the right overloadedRexBiVisitor.visitInputRef(RexInputRef, Object)
visitXxx} method.<R> R
accept(RexVisitor<R> visitor)
Accepts a visitor, dispatching to the right overloadedvisitXxx
method.boolean
equals(java.lang.Object obj)
int
getIdentifier()
SqlKind
getKind()
Returns the kind of node this is.java.util.List<java.lang.String>
getQualifiedName()
RexTableInputRef.RelTableRef
getTableRef()
int
hashCode()
static RexTableInputRef
of(RexTableInputRef.RelTableRef tableRef, int index, RelDataType type)
static RexTableInputRef
of(RexTableInputRef.RelTableRef tableRef, RexInputRef ref)
-
Methods inherited from class org.apache.calcite.rex.RexInputRef
createName, of, of, of2
-
Methods inherited from class org.apache.calcite.rex.RexVariable
getName, getType
-
Methods inherited from class org.apache.calcite.rex.RexNode
isA, isA, isAlwaysFalse, isAlwaysTrue, toString
-
-
-
-
Field Detail
-
tableRef
private final RexTableInputRef.RelTableRef tableRef
-
-
Constructor Detail
-
RexTableInputRef
private RexTableInputRef(RexTableInputRef.RelTableRef tableRef, int index, RelDataType type)
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:RexNode
Every node must implement
RexNode.equals(java.lang.Object)
based on its content- Overrides:
equals
in classRexInputRef
-
hashCode
public int hashCode()
Description copied from class:RexNode
Every node must implement
RexNode.hashCode()
consistent withRexNode.equals(java.lang.Object)
- Overrides:
hashCode
in classRexInputRef
-
getTableRef
public RexTableInputRef.RelTableRef getTableRef()
-
getQualifiedName
public java.util.List<java.lang.String> getQualifiedName()
-
getIdentifier
public int getIdentifier()
-
of
public static RexTableInputRef of(RexTableInputRef.RelTableRef tableRef, int index, RelDataType type)
-
of
public static RexTableInputRef of(RexTableInputRef.RelTableRef tableRef, RexInputRef ref)
-
accept
public <R> R accept(RexVisitor<R> visitor)
Description copied from class:RexNode
Accepts a visitor, dispatching to the right overloadedvisitXxx
method.Also see
RexUtil.apply(RexVisitor, java.util.List, RexNode)
, which applies a visitor to several expressions simultaneously.- Overrides:
accept
in classRexInputRef
-
accept
public <R,P> R accept(RexBiVisitor<R,P> visitor, P arg)
Description copied from class:RexNode
Accepts a visitor with a payload, dispatching to the right overloadedRexBiVisitor.visitInputRef(RexInputRef, Object)
visitXxx} method.- Overrides:
accept
in classRexInputRef
-
getKind
public SqlKind getKind()
Description copied from class:RexNode
Returns the kind of node this is.- Overrides:
getKind
in classRexInputRef
- Returns:
- Node kind, never null
-
-