Github user willb commented on the pull request:

    https://github.com/apache/spark/pull/1136#issuecomment-46640150
  
    So I've added a cast in cases in which non-boolean expressions are supplied 
to having expressions.  It appears that `Cast(_, BooleanType)` isn't 
idempotent, though -- if you apply it to a Boolean (say, `x > 4`), it will 
translate that to `NOT ((x > 4) = 0)`.  This seems like a bug, but it's 
possible that I'm missing the reason why it should work that way.  Should I 
change `Cast` so that casting an _X_ to _X_ is a no-op?
    
    (Checking the type of a variable during parse doesn't work, so I wind up 
with a different exception in examples like the one you posted.  I'll either 
need to fix the behavior of `Cast` or delay adding the cast until I have type 
information.)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to