Package org.apache.calcite.rex
Class LogicVisitor
- java.lang.Object
-
- org.apache.calcite.rex.LogicVisitor
-
- All Implemented Interfaces:
RexBiVisitor<RelOptUtil.Logic,RelOptUtil.Logic>
public class LogicVisitor extends java.lang.Object implements RexBiVisitor<RelOptUtil.Logic,RelOptUtil.Logic>
Visitor pattern for traversing a tree ofRexNode
objects.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Collection<RelOptUtil.Logic>
logicCollection
private RexNode
seek
-
Constructor Summary
Constructors Modifier Constructor Description private
LogicVisitor(RexNode seek, java.util.Collection<RelOptUtil.Logic> logicCollection)
Creates a LogicVisitor.
-
Method Summary
-
-
-
Field Detail
-
seek
private final RexNode seek
-
logicCollection
private final java.util.Collection<RelOptUtil.Logic> logicCollection
-
-
Constructor Detail
-
LogicVisitor
private LogicVisitor(RexNode seek, java.util.Collection<RelOptUtil.Logic> logicCollection)
Creates a LogicVisitor.
-
-
Method Detail
-
find
public static RelOptUtil.Logic find(RelOptUtil.Logic logic, java.util.List<RexNode> nodes, RexNode seek)
Finds a suitable logic for evaluatingseek
within a list of expressions.Chooses a logic that is safe (that is, gives the right answer) with the fewest possibilities (that is, we prefer one that returns [true as true, false as false, unknown as false] over one that distinguishes false from unknown).
-
collect
public static void collect(RexNode node, RexNode seek, RelOptUtil.Logic logic, java.util.List<RelOptUtil.Logic> logicList)
-
visitCall
public RelOptUtil.Logic visitCall(RexCall call, RelOptUtil.Logic logic)
- Specified by:
visitCall
in interfaceRexBiVisitor<RelOptUtil.Logic,RelOptUtil.Logic>
-
end
private RelOptUtil.Logic end(RexNode node, RelOptUtil.Logic arg)
-
visitInputRef
public RelOptUtil.Logic visitInputRef(RexInputRef inputRef, RelOptUtil.Logic arg)
- Specified by:
visitInputRef
in interfaceRexBiVisitor<RelOptUtil.Logic,RelOptUtil.Logic>
-
visitLocalRef
public RelOptUtil.Logic visitLocalRef(RexLocalRef localRef, RelOptUtil.Logic arg)
- Specified by:
visitLocalRef
in interfaceRexBiVisitor<RelOptUtil.Logic,RelOptUtil.Logic>
-
visitLiteral
public RelOptUtil.Logic visitLiteral(RexLiteral literal, RelOptUtil.Logic arg)
- Specified by:
visitLiteral
in interfaceRexBiVisitor<RelOptUtil.Logic,RelOptUtil.Logic>
-
visitOver
public RelOptUtil.Logic visitOver(RexOver over, RelOptUtil.Logic arg)
- Specified by:
visitOver
in interfaceRexBiVisitor<RelOptUtil.Logic,RelOptUtil.Logic>
-
visitCorrelVariable
public RelOptUtil.Logic visitCorrelVariable(RexCorrelVariable correlVariable, RelOptUtil.Logic arg)
- Specified by:
visitCorrelVariable
in interfaceRexBiVisitor<RelOptUtil.Logic,RelOptUtil.Logic>
-
visitDynamicParam
public RelOptUtil.Logic visitDynamicParam(RexDynamicParam dynamicParam, RelOptUtil.Logic arg)
- Specified by:
visitDynamicParam
in interfaceRexBiVisitor<RelOptUtil.Logic,RelOptUtil.Logic>
-
visitRangeRef
public RelOptUtil.Logic visitRangeRef(RexRangeRef rangeRef, RelOptUtil.Logic arg)
- Specified by:
visitRangeRef
in interfaceRexBiVisitor<RelOptUtil.Logic,RelOptUtil.Logic>
-
visitFieldAccess
public RelOptUtil.Logic visitFieldAccess(RexFieldAccess fieldAccess, RelOptUtil.Logic arg)
- Specified by:
visitFieldAccess
in interfaceRexBiVisitor<RelOptUtil.Logic,RelOptUtil.Logic>
-
visitSubQuery
public RelOptUtil.Logic visitSubQuery(RexSubQuery subQuery, RelOptUtil.Logic arg)
- Specified by:
visitSubQuery
in interfaceRexBiVisitor<RelOptUtil.Logic,RelOptUtil.Logic>
-
visitTableInputRef
public RelOptUtil.Logic visitTableInputRef(RexTableInputRef ref, RelOptUtil.Logic arg)
- Specified by:
visitTableInputRef
in interfaceRexBiVisitor<RelOptUtil.Logic,RelOptUtil.Logic>
-
visitPatternFieldRef
public RelOptUtil.Logic visitPatternFieldRef(RexPatternFieldRef ref, RelOptUtil.Logic arg)
- Specified by:
visitPatternFieldRef
in interfaceRexBiVisitor<RelOptUtil.Logic,RelOptUtil.Logic>
-
-