Package org.apache.calcite.plan
Class RexImplicationChecker.InputUsageFinder
- java.lang.Object
-
- org.apache.calcite.rex.RexVisitorImpl<java.lang.Void>
-
- org.apache.calcite.plan.RexImplicationChecker.InputUsageFinder
-
- All Implemented Interfaces:
RexVisitor<java.lang.Void>
- Enclosing class:
- RexImplicationChecker
private static class RexImplicationChecker.InputUsageFinder extends RexVisitorImpl<java.lang.Void>
Visitor that builds a usage map of inputs used by an expression.E.g: for x > 10 AND y < 20 AND x = 40, usage map is as follows:
- key: x value: {(>, 10),(=, 40), usageCount = 2}
- key: y value: {(>, 20), usageCount = 1}
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.Map<RexInputRef,RexImplicationChecker.InputRefUsage<SqlOperator,RexNode>>
usageMap
-
Fields inherited from class org.apache.calcite.rex.RexVisitorImpl
deep
-
-
Constructor Summary
Constructors Constructor Description InputUsageFinder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private RexImplicationChecker.InputRefUsage<SqlOperator,RexNode>
getUsageMap(RexInputRef rex)
private static RexNode
removeCast(RexNode inputRef)
private SqlOperator
reverse(SqlOperator op)
private void
updateBinaryOpUsage(RexCall call)
private void
updateUnaryOpUsage(RexCall call)
private void
updateUsage(SqlOperator op, RexInputRef inputRef, RexNode literal)
java.lang.Void
visitCall(RexCall call)
java.lang.Void
visitInputRef(RexInputRef inputRef)
-
Methods inherited from class org.apache.calcite.rex.RexVisitorImpl
visitArrayAnd, visitArrayOr, visitCorrelVariable, visitDynamicParam, visitFieldAccess, visitLiteral, visitLocalRef, visitOver, visitPatternFieldRef, visitRangeRef, visitSubQuery, visitTableInputRef
-
-
-
-
Field Detail
-
usageMap
final java.util.Map<RexInputRef,RexImplicationChecker.InputRefUsage<SqlOperator,RexNode>> usageMap
-
-
Method Detail
-
visitInputRef
public java.lang.Void visitInputRef(RexInputRef inputRef)
- Specified by:
visitInputRef
in interfaceRexVisitor<java.lang.Void>
- Overrides:
visitInputRef
in classRexVisitorImpl<java.lang.Void>
-
visitCall
public java.lang.Void visitCall(RexCall call)
- Specified by:
visitCall
in interfaceRexVisitor<java.lang.Void>
- Overrides:
visitCall
in classRexVisitorImpl<java.lang.Void>
-
updateUnaryOpUsage
private void updateUnaryOpUsage(RexCall call)
-
updateBinaryOpUsage
private void updateBinaryOpUsage(RexCall call)
-
reverse
private SqlOperator reverse(SqlOperator op)
-
updateUsage
private void updateUsage(SqlOperator op, RexInputRef inputRef, RexNode literal)
-
getUsageMap
private RexImplicationChecker.InputRefUsage<SqlOperator,RexNode> getUsageMap(RexInputRef rex)
-
-