zabetak commented on a change in pull request #1029: [CALCITE-2824] Fix invalid 
usage of RexExecutorImpl
URL: https://github.com/apache/calcite/pull/1029#discussion_r261560347
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rex/RexExecutor.java
 ##########
 @@ -32,6 +34,22 @@
    * @param reducedValues List to which reduced expressions are appended
    */
   void reduce(RexBuilder rexBuilder, List<RexNode> constExps, List<RexNode> 
reducedValues);
+
+  /**
+   * Checks if condition first implies (&rArr;) condition second.
+   *
+   * <p>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.
+   *
+   * @param rexBuilder Rex builder
+   * @param rowType row type
+   * @param first first condition
+   * @param second second condition
+   * @return true if it can prove first &rArr; second; otherwise false i.e.,
+   * it doesn't know if implication holds
+   */
+  boolean implies(RexBuilder rexBuilder, RelDataType rowType, RexNode first, 
RexNode second);
 
 Review comment:
   I am not in favor of adding this method in the RexExecutor interface. Many 
similar methods exist in RexImplicationChecker which is already public API. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to