Github user liancheng commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2344#discussion_r18697748
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
 ---
    @@ -56,7 +60,9 @@ case class Cast(child: Expression, dataType: DataType) 
extends UnaryExpression {
         case StringType =>
           buildCast[String](_, _.length() != 0)
         case TimestampType =>
    -      buildCast[Timestamp](_, b => b.getTime() != 0 || b.getNanos() != 0)
    +      buildCast[Timestamp](_, t => t.getTime() != 0 || t.getNanos() != 0)
    +    case DateType =>
    +      buildCast[Date](_, d => null)
    --- End diff --
    
    Leaving a comment here would be good. It's really unintuitive here to see a 
timestamp can be casted to a boolean while a date has to be null.


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to