org.eigenbase.rex
Class RexInputRef
java.lang.Object
org.eigenbase.rex.RexNode
org.eigenbase.rex.RexVariable
org.eigenbase.rex.RexSlot
org.eigenbase.rex.RexInputRef
public class RexInputRef
- extends RexSlot
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.
- Since:
- Nov 24, 2003
- Version:
- $Id: //open/dev/farrago/src/org/eigenbase/rex/RexInputRef.java#16 $
- Author:
- jhyde
names
private static final String[] names
RexInputRef
public RexInputRef(int index,
RelDataType type)
- Creates an input variable.
- Parameters:
index
- Index of the field in the underlying rowtypetype
- Type of the column- "Precondition:"
- type != null, index >= 0
clone
public RexInputRef clone()
- Specified by:
clone
in class RexNode
accept
public <R> R accept(RexVisitor<R> visitor)
- Description copied from class:
RexNode
- Accepts a visitor, dispatching to the right overloaded
visitXxx
method.
Also see RexProgram.apply(RexVisitor, RexNode[], RexNode)
,
which applies a visitor to several expressions simultaneously.
- Specified by:
accept
in class RexNode
createName
public static String createName(int index)
- 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.