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