Class RexNodeAndFieldIndex


public class RexNodeAndFieldIndex extends RexVariable
RexNodeAndFieldIndex has the same meaning as RexInputRef, they are both reference a field of an input relational expression. The difference is that, RexNodeAndFieldIndex uses the input index and the relative position of field in input rowType.

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:

  • Node #0, Field #0: EMPNO
  • Node #0, Field #1: ENAME
  • Node #0, Field #2: DEPTNO (from EMP)
  • Node #1, Field #0: DEPTNO2 (from DEPT)
  • Node #1, Field #1: DNAME

If in some cases, the inputs order of a relation is frequently adjusted and it is difficult to maintain the correct RexInputRef, you can consider temporarily replacing RexInputRef with RexNodeAndFieldIndex.

See Also: