public class RexRangeRef extends RexNode
This construct is used only during the process of translating a
SQL
tree to a
rel
/rex
tree. Regular rex
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 the RexInputRef
(5,Integer)RexRangeRef
will disappear.
Modifier and Type | Field and Description |
---|---|
private int |
offset |
private RelDataType |
type |
Constructor and Description |
---|
RexRangeRef(RelDataType rangeType,
int offset)
Creates a range reference.
|
Modifier and Type | Method and Description |
---|---|
<R,P> R |
accept(RexBiVisitor<R,P> visitor,
P arg)
Accepts a visitor with a payload, dispatching to the right overloaded
RexBiVisitor.visitInputRef(RexInputRef, Object) visitXxx} method. |
<R> R |
accept(RexVisitor<R> visitor)
Accepts a visitor, dispatching to the right overloaded
visitXxx method. |
boolean |
equals(java.lang.Object obj) |
int |
getOffset() |
RelDataType |
getType() |
int |
hashCode() |
getKind, isA, isA, isAlwaysFalse, isAlwaysTrue, toString
private final RelDataType type
private final int offset
RexRangeRef(RelDataType rangeType, int offset)
rangeType
- Type of the record returnedoffset
- Offset of the first column within the input recordpublic RelDataType getType()
public int getOffset()
public <R> R accept(RexVisitor<R> visitor)
RexNode
visitXxx
method.
Also see RexUtil.apply(RexVisitor, java.util.List, RexNode)
,
which applies a visitor to several expressions simultaneously.
public <R,P> R accept(RexBiVisitor<R,P> visitor, P arg)
RexNode
RexBiVisitor.visitInputRef(RexInputRef, Object)
visitXxx} method.public boolean equals(java.lang.Object obj)
RexNode
Every node must implement RexNode.equals(java.lang.Object)
based on its content
public int hashCode()
RexNode
Every node must implement RexNode.hashCode()
consistent with
RexNode.equals(java.lang.Object)
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.