Package org.apache.calcite.rex
Class RexFieldAccess
- java.lang.Object
-
- org.apache.calcite.rex.RexNode
-
- org.apache.calcite.rex.RexFieldAccess
-
public class RexFieldAccess extends 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 expressionemp.empno
in the querySELECT 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 expressionemp.deptno
inSELECT ename FROM dept WHERE EXISTS ( SELECT NULL FROM emp WHERE emp.deptno = dept.deptno AND gender = 'F')
-
-
Constructor Summary
Constructors Constructor Description RexFieldAccess(RexNode expr, RelDataTypeField field)
-
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 o)
RelDataTypeField
getField()
SqlKind
getKind()
Returns the kind of node this is.RexNode
getReferenceExpr()
Returns the expression whose field is being accessed.RelDataType
getType()
int
hashCode()
-
Methods inherited from class org.apache.calcite.rex.RexNode
isA, isA, isAlwaysFalse, isAlwaysTrue, toString
-
-
-
-
Field Detail
-
expr
private final RexNode expr
-
field
private final RelDataTypeField field
-
-
Constructor Detail
-
RexFieldAccess
RexFieldAccess(RexNode expr, RelDataTypeField field)
-
-
Method Detail
-
getField
public RelDataTypeField getField()
-
getType
public RelDataType getType()
-
getKind
public SqlKind getKind()
Description copied from class:RexNode
Returns the kind of node this is.
-
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.
-
getReferenceExpr
public RexNode getReferenceExpr()
Returns the expression whose field is being accessed.
-
equals
public boolean equals(java.lang.Object o)
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)
-
-