Package org.apache.calcite.rex
Class RexInputRef
java.lang.Object
org.apache.calcite.rex.RexNode
org.apache.calcite.rex.RexVariable
org.apache.calcite.rex.RexSlot
org.apache.calcite.rex.RexInputRef
- Direct Known Subclasses:
RexPatternFieldRef
,RexTableInputRef
Variable which references a field of an input relational expression.
Fields of the input are 0-based. If there is more than one input, they are numbered consecutively. For example, if the inputs to a join are
- Input #0: EMP(EMPNO, ENAME, DEPTNO) and
- Input #1: DEPT(DEPTNO AS DEPTNO2, DNAME)
then the fields are:
- Field #0: EMPNO
- Field #1: ENAME
- Field #2: DEPTNO (from EMP)
- Field #3: DEPTNO2 (from DEPT)
- Field #4: DNAME
So RexInputRef(3, Integer)
is the correct reference for the
field DEPTNO2.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.calcite.rex.RexSlot
RexSlot.SelfPopulatingList
-
Field Summary
Fields inherited from class org.apache.calcite.rex.RexVariable
name, type
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<R,
P> R accept
(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.static void
Adds to a PairList a reference to a given field in a list of fields.static String
createName
(int index) Creates a name for an input reference, of the form "$index".boolean
getKind()
Returns the kind of node this is.int
hashCode()
static RexInputRef
of
(int index, List<RelDataTypeField> fields) Creates a reference to a given field in a list of fields.static RexInputRef
of
(int index, RelDataType rowType) Creates a reference to a given field in a row type.of2
(int index, List<RelDataTypeField> fields) Creates a reference to a given field in a list of fields.Methods inherited from class org.apache.calcite.rex.RexVariable
getName, getType
Methods inherited from class org.apache.calcite.rex.RexNode
isA, isA, isAlwaysFalse, isAlwaysTrue, nodeCount, toString
-
Constructor Details
-
RexInputRef
Creates an input variable.- Parameters:
index
- Index of the field in the underlying row-typetype
- Type of the column
-
-
Method Details
-
equals
Description copied from class:RexNode
Every node must implement
RexNode.equals(java.lang.Object)
based on its content -
hashCode
public int hashCode()Description copied from class:RexNode
Every node must implement
RexNode.hashCode()
consistent withRexNode.equals(java.lang.Object)
-
of
Creates a reference to a given field in a row type. -
of
Creates a reference to a given field in a list of fields. -
of2
Creates a reference to a given field in a list of fields. -
add2
Adds to a PairList a reference to a given field in a list of fields. -
getKind
Description copied from class:RexNode
Returns the kind of node this is. -
accept
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. -
accept
Description copied from class:RexNode
Accepts a visitor with a payload, dispatching to the right overloadedRexBiVisitor.visitInputRef(RexInputRef, Object)
visitXxx} method. -
createName
Creates a name for an input reference, of the form "$index". If the index is low, uses a cache of common names, to reduce gc.
-