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:
[email protected]
With regards,
Apache Git Services