Package org.apache.calcite.rex
Class RexNodeAndFieldIndex
java.lang.Object
org.apache.calcite.rex.RexNode
org.apache.calcite.rex.RexVariable
org.apache.calcite.rex.RexNodeAndFieldIndex
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:
-
JoinToHyperGraphRuleHyperGraph.extractJoinCond(java.util.List<org.apache.calcite.rel.rules.HyperGraph.NodeState>, int, java.util.List<org.apache.calcite.rel.rules.HyperEdge>, org.apache.calcite.rel.core.JoinRelType)HyperEdge.createHyperEdgesFromJoinConds(java.util.Map<java.lang.Integer, java.lang.Integer>, java.util.Map<java.lang.Integer, java.lang.Integer>, java.util.List<org.apache.calcite.rex.RexNode>, java.util.List<org.apache.calcite.rel.rules.ConflictRule>, org.apache.calcite.rel.core.JoinRelType, int, int)
-
Field Summary
Fields inherited from class org.apache.calcite.rex.RexVariable
name, type -
Constructor Summary
ConstructorsConstructorDescriptionRexNodeAndFieldIndex(int nodeIndex, int fieldIndex, String name, RelDataType type) -
Method Summary
Modifier and TypeMethodDescription<R,P> R accept(RexBiVisitor<R, P> visitor, P arg) Accepts a visitor with a payload, dispatching to the right overloadedRexBiVisitor.visitInputRef(RexInputRef, Object)visitXxx} method.<R> Raccept(RexVisitor<R> visitor) Accepts a visitor, dispatching to the right overloadedvisitXxxmethod.booleanintintinthashCode()toString()Methods inherited from class org.apache.calcite.rex.RexVariable
getName, getTypeMethods inherited from class org.apache.calcite.rex.RexNode
getKind, isA, isA, isAlwaysFalse, isAlwaysTrue, nodeCount
-
Constructor Details
-
RexNodeAndFieldIndex
-
-
Method Details
-
getNodeIndex
public int getNodeIndex() -
getFieldIndex
public int getFieldIndex() -
accept
Description copied from class:RexNodeAccepts a visitor, dispatching to the right overloadedvisitXxxmethod.Also see
RexUtil.apply(RexVisitor, java.util.List, RexNode), which applies a visitor to several expressions simultaneously. -
accept
Description copied from class:RexNodeAccepts a visitor with a payload, dispatching to the right overloadedRexBiVisitor.visitInputRef(RexInputRef, Object)visitXxx} method. -
equals
Description copied from class:RexNodeEvery node must implement
RexNode.equals(java.lang.Object)based on its content -
hashCode
public int hashCode()Description copied from class:RexNodeEvery node must implement
RexNode.hashCode()consistent withRexNode.equals(java.lang.Object) -
toString
-