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/03/26 04:58:44 UTC

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

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

 ##########
 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:
   Does the issue only happen on TimeStamp? how about TimeStamp with local zone? or Date?

----------------------------------------------------------------
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