You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/04/04 19:02:15 UTC

[GitHub] [calcite] jh3507 commented on a change in pull request #1131: [CALCITE-2829] Fix RexSimplify#processRange cast issue

jh3507 commented on a change in pull request #1131: [CALCITE-2829] Fix RexSimplify#processRange cast issue
URL: https://github.com/apache/calcite/pull/1131#discussion_r272322621
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rex/RexSimplify.java
 ##########
 @@ -315,6 +316,18 @@ private RexNode simplifyComparison(RexCall e, RexUnknownAs unknownAs) {
   // e must be a comparison (=, >, >=, <, <=, !=)
   private <C extends Comparable<C>> RexNode simplifyComparison(RexCall e,
       RexUnknownAs unknownAs, Class<C> clazz) {
+    List<RelDataType> types = RexUtil.types(e.operands);
+
+    RelDataType type = SqlTypeUtil.consistentType(rexBuilder.getTypeFactory(),
+        SqlOperandTypeChecker.Consistency.COMPARE, types);
+    if ((type != null)
+        && (type.getSqlTypeName() == SqlTypeName.TIMESTAMP)
 
 Review comment:
   Thanks for the comment. I don't think this issue is only for Timestamp. So, I generalized this and added it as a method in Comparison.

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


With regards,
Apache Git Services