Re: from_unix time problem

2013-09-17 Thread Robert Li
Thanks, that worked!! On Tue, Sep 17, 2013 at 12:56 PM, Mark Grover wrote: > Stephen is right. Here is some context: > Looking at the UDF source code ( > https://github.com/apache/hive/blob/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFFromUnixTime.java#L121), > it's using SimpleDateForma

Re: from_unix time problem

2013-09-17 Thread Mark Grover
Stephen is right. Here is some context: Looking at the UDF source code ( https://github.com/apache/hive/blob/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFFromUnixTime.java#L121), it's using SimpleDateFormat where the format string follows the convention at http://docs.oracle.com/javase/1.4.2

Re: from_unix time problem

2013-09-17 Thread Stephen Sprague
what happens if you use HH (instead of hh)? Any diff? On Tue, Sep 17, 2013 at 8:49 AM, Robert Li wrote: > Hi All > > I have a query where I want to convert the unix timestamp to an hour and > day bucket like so. > > *select case * > *when from_unixtime(cast(ts as bigint),'hh:mm') BETWEEN "00:0

from_unix time problem

2013-09-17 Thread Robert Li
Hi All I have a query where I want to convert the unix timestamp to an hour and day bucket like so. *select case * *when from_unixtime(cast(ts as bigint),'hh:mm') BETWEEN "00:01" and "00:15" then "00:15"* *when from_unixtime(cast(ts as bigint),'hh:mm') BETWEEN "00:16" and "00:30" then "00:30"* *.