hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anup (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HIVE-14657) datediff function produce different results with timestamp and string combination
Date Fri, 26 Aug 2016 21:40:20 GMT
Anup created HIVE-14657:
---------------------------

             Summary: datediff function produce different results with timestamp and string
combination
                 Key: HIVE-14657
                 URL: https://issues.apache.org/jira/browse/HIVE-14657
             Project: Hive
          Issue Type: Bug
          Components: Hive
    Affects Versions: 0.13.0
            Reporter: Anup
            Priority: Minor


when we use datediff function with string and timestamp type, it produces different results.


See below queries:

select datediff("2016-08-18 16:48:12", "2016-07-18 12:54:54") from test2;
31
select datediff("2016-08-18 16:48:12", date) from test2;
30
select datediff("2016-08-18 16:48:12", cast(date as string)) from test2;
31

hive> desc test2;
OK
date                    timestamp 


hive> select * from test2;
OK
2016-07-18 12:54:54



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message