Github user davies commented on the pull request:

    https://github.com/apache/spark/pull/7353#issuecomment-121682853
  
    In master, we can't cast `'238'` as timestamp,
    ```
    spark-sql> select DATEDIFF(CAST(238 AS timestamp), CAST('2002-03-21 
00:00:00' AS timestamp));
    -11767
    Time taken: 0.171 seconds, Fetched 1 row(s)
    spark-sql> select DATEDIFF(CAST('238' AS timestamp), CAST('2002-03-21 
00:00:00' AS timestamp));
    NULL
    Time taken: 0.1 seconds, Fetched 1 row(s)
    ```
    I think you should check that the year is larger than `1000`.


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