Package org.apache.calcite.plan
Class RexImplicationChecker
java.lang.Object
org.apache.calcite.plan.RexImplicationChecker
Checks whether one condition logically implies another.
If A ⇒ B, whenever A is true, B will be true also.
For example:
- (x > 10) ⇒ (x > 5)
- (x = 10) ⇒ (x < 30 OR y > 30)
- (x = 10) ⇒ (x IS NOT NULL)
- (x > 10 AND y = 20) ⇒ (x > 5)
-
Constructor Summary
ConstructorDescriptionRexImplicationChecker
(RexBuilder builder, RexExecutor executor, RelDataType rowType) -
Method Summary
-
Constructor Details
-
RexImplicationChecker
-
-
Method Details
-
implies
Checks if condition first implies (⇒) condition second.This reduces to SAT problem which is NP-Complete. When this method says first implies second then it is definitely true. But it cannot prove that first does not imply second.
- Parameters:
first
- first conditionsecond
- second condition- Returns:
- true if it can prove first ⇒ second; otherwise false i.e., it doesn't know if implication holds
-