Class RexFieldAccess


  • public class RexFieldAccess
    extends org.apache.calcite.rex.RexNode
    Access to a field of a row-expression.

    You might expect to use a RexFieldAccess to access columns of relational tables, for example, the expression emp.empno in the query

    SELECT emp.empno FROM emp

    but there is a specialized expression RexInputRef for this purpose. So in practice, RexFieldAccess is usually used to access fields of correlating variables, for example the expression emp.deptno in

    SELECT ename
     FROM dept
     WHERE EXISTS (
         SELECT NULL
         FROM emp
         WHERE emp.deptno = dept.deptno
         AND gender = 'F')

    FLINK modifications are at lines

    1. Should be removed after fixing CALCITE-6342 (Calcite 1.36.0): Lines 83-87
    • Field Summary

      • Fields inherited from class org.apache.calcite.rex.RexNode

        digest
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <R,​P>
      R
      accept​(org.apache.calcite.rex.RexBiVisitor<R,​P> visitor, P arg)  
      <R> R accept​(org.apache.calcite.rex.RexVisitor<R> visitor)  
      boolean equals​(@Nullable Object o)  
      org.apache.calcite.rel.type.RelDataTypeField getField()  
      org.apache.calcite.sql.SqlKind getKind()  
      org.apache.calcite.rex.RexNode getReferenceExpr()
      Returns the expression whose field is being accessed.
      org.apache.calcite.rel.type.RelDataType getType()  
      int hashCode()  
      • Methods inherited from class org.apache.calcite.rex.RexNode

        isA, isA, isAlwaysFalse, isAlwaysTrue, nodeCount, toString
    • Method Detail

      • getField

        public org.apache.calcite.rel.type.RelDataTypeField getField()
      • getType

        public org.apache.calcite.rel.type.RelDataType getType()
        Specified by:
        getType in class org.apache.calcite.rex.RexNode
      • getKind

        public org.apache.calcite.sql.SqlKind getKind()
        Overrides:
        getKind in class org.apache.calcite.rex.RexNode
      • accept

        public <R> R accept​(org.apache.calcite.rex.RexVisitor<R> visitor)
        Specified by:
        accept in class org.apache.calcite.rex.RexNode
      • accept

        public <R,​P> R accept​(org.apache.calcite.rex.RexBiVisitor<R,​P> visitor,
                                    P arg)
        Specified by:
        accept in class org.apache.calcite.rex.RexNode
      • getReferenceExpr

        public org.apache.calcite.rex.RexNode getReferenceExpr()
        Returns the expression whose field is being accessed.
      • equals

        public boolean equals​(@Nullable Object o)
        Specified by:
        equals in class org.apache.calcite.rex.RexNode
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in class org.apache.calcite.rex.RexNode