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


##########
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:
   My apologies and thank you for your patience.  My attempt at efficiency 
failed miserably.  
   I've restored the previous logic that lived in the CAST case and all tests 
currently pass.
   
   If I add a top level assert 
      ` 222 +    assert getType().getSqlTypeName() == SqlTypeName.BOOLEAN       
                                                                                
                                                       
         223 +        : "isAlwaysTrue() called on non-boolean: " + getType();  `
   then these 3 tests will fail 
   - testIsAlwaysTrueCastBooleanToInteger
   - testIsAlwaysFalseCastBooleanToInteger
   - testIsAlwaysTrueFalseCastNonBooleanCallToBoolean
   
   Perhaps you have a different idea of where to place the assert?



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