sbroeder commented on code in PR #4959:
URL: https://github.com/apache/calcite/pull/4959#discussion_r3295931567


##########
core/src/main/java/org/apache/calcite/rex/RexCall.java:
##########
@@ -228,8 +228,13 @@ private boolean digestWithType() {
       return operands.get(0).isAlwaysFalse();
     case IS_NOT_FALSE:
     case IS_TRUE:
-    case CAST:
       return operands.get(0).isAlwaysTrue();
+    case CAST:

Review Comment:
   Yes, many fail.  In RexProgramTest alone these fail, but there are others;
   testSimplifyRecurseIntoArithmetics()
   testSimplifyVarbinary()
   testSimplifyNullCheckInFilter()
   testSimplifyMeasure()
   testSimplifyIsNullDivideWithNullArgument()
   testSimplifyDivideSafe()
   testSimplifyCondition2()
   testSimplifyCondition()
   testSimplifyCoalesce()
   testSimplifyCastLiteral2()
   testSimplifyCaseNullableVarChar()
   testSimplifyCaseCompactionDiv()
   testSimplifyCaseCompaction2()
   testSimplifyCaseCompaction()
   testIsAlwaysTrueFalseCastNonBooleanCallToBoolean()
   testIsAlwaysTrueCastBooleanToInteger()
   
   So are you happy for me to return false early in the top of isAlwaysTrue and 
isAlwaysFalse if the type is not a boolean?
   



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to