Github user davies commented on the pull request:

    https://github.com/apache/spark/pull/7847#issuecomment-126935369
  
    @adrian-wang I understand you concern, our goal is to be Hive compatible at 
our best, not follow the implementation details in Hive.
    
    For datediff, these expression should be have the same results:
    ```
    select datediff('2015-05-06', '2015-05-05')
    select datediff(cast('2015-05-06' as date), cast('2015-05-05' as date))
    select datediff('2015-05-06 00:00:01', '2015-05-05 23:59:59')
    select datediff(cast('2015-05-06 00:00:01' as timestamp), cast('2015-05-05 
23:59:59' as timestamp))
    ```
    This is the behavior in MySQL and MS SQL Server, correct me if it's not.
    
    But in Hive, the fourth one is different, kind of silly, I think we should 
not follow that. We also break the compatibility already (returning different 
type).



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