hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arun A K (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-3850) hour() function returns 12 hour clock value when using timestamp datatype
Date Mon, 28 Jan 2013 12:35:13 GMT

    [ https://issues.apache.org/jira/browse/HIVE-3850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13564233#comment-13564233
] 

Arun A K commented on HIVE-3850:
--------------------------------

[~pieterjan],

I have checked the following 4 queries,
1) select hour('1:58:59') FROM myTable;
Result >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
1
2) select hour('13:58:59') FROM myTable;
Result >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
13
3) select hour('2009-07-30 10:58:59') FROM myTable;
Result >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
10
4) select hour('2009-07-30 14:58:59') FROM myTable;
Result >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
14

I have got the response in 24 hour clock time aswell. 

Have I interpretted it wrong? Please comment on the same.  

                
> hour() function returns 12 hour clock value when using timestamp datatype
> -------------------------------------------------------------------------
>
>                 Key: HIVE-3850
>                 URL: https://issues.apache.org/jira/browse/HIVE-3850
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.9.0
>            Reporter: Pieterjan Vriends
>
> Apparently UDFHour.java does have two evaluate() functions. One that does accept a Text
object as parameter and one that does use a TimeStampWritable object as parameter. The first
function does return the value of Calendar.HOUR_OF_DAY and the second one of Calendar.HOUR.
In the documentation I couldn't find any information on the overload of the evaluation function.
I did spent quite some time finding out why my statement didn't return a 24 hour clock value.
> Shouldn't both functions return the same?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message