Class RexRangeRef
- java.lang.Object
-
- org.apache.calcite.rex.RexNode
-
- org.apache.calcite.rex.RexRangeRef
-
public class RexRangeRef extends RexNode
Reference to a range of columns.This construct is used only during the process of translating a
SQL
tree to arel
/rex
tree. Regularrex
trees do not contain this construct.While translating a join of EMP(EMPNO, ENAME, DEPTNO) to DEPT(DEPTNO2, DNAME) we create
RexRangeRef(DeptType,3)
to represent the pair of columns (DEPTNO2, DNAME) which came from DEPT. The type has 2 columns, and therefore the range represents columns {3, 4} of the input.Suppose we later create a reference to the DNAME field of this RexRangeRef; it will return a
, and theRexInputRef
(5,Integer)RexRangeRef
will disappear.
-
-
Field Summary
Fields Modifier and Type Field Description private int
offset
private RelDataType
type
-
Constructor Summary
Constructors Constructor Description RexRangeRef(RelDataType rangeType, int offset)
Creates a range reference.
-
Method Summary
All 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
getOffset()
RelDataType
getType()
int
hashCode()
-
Methods inherited from class org.apache.calcite.rex.RexNode
getKind, isA, isA, isAlwaysFalse, isAlwaysTrue, toString
-
-
-
-
Field Detail
-
type
private final RelDataType type
-
offset
private final int offset
-
-
Constructor Detail
-
RexRangeRef
RexRangeRef(RelDataType rangeType, int offset)
Creates a range reference.- Parameters:
rangeType
- Type of the record returnedoffset
- Offset of the first column within the input record
-
-
Method Detail
-
getType
public RelDataType getType()
-
getOffset
public int getOffset()
-
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.
-
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.
-
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
-
hashCode
public int hashCode()
Description copied from class:RexNode
Every node must implement
RexNode.hashCode()
consistent withRexNode.equals(java.lang.Object)
-
-