Hi Tom,

I think you want to use the from_unixtime UDF:

hive> describe function extended from_unixtime;
describe function extended from_unixtime;
OK
from_unixtime(unix_time, format) - returns unix_time in the specified format
Example:
  > SELECT from_unixtime(0, 'yyyy-MM-dd HH:mm:ss') FROM src LIMIT 1;
  '1970-01-01 00:00:00'
Time taken: 0.647 seconds
hive>

Thanks.

Carl

On Thu, Apr 1, 2010 at 1:11 PM, tom kersnick <[email protected]> wrote:

> hive> describe ut;
> OK
> time    bigint
> day    string
> Time taken: 0.128 seconds
> hive> select * from ut;
> OK
> 1270145333155    tuesday
> Time taken: 0.085 seconds
>
> When I run this simple query, I'm getting a NULL for the time column with
> data type bigint.
>
> hive> select unix_timestamp(time),day from ut;
> Total MapReduce jobs = 1
> Launching Job 1 out of 1
> Number of reduce tasks is set to 0 since there's no reduce operator
> Starting Job = job_201003031204_0080, Tracking URL =
> http://master:50030/jobdetails.jsp?jobid=job_201003031204_0080
> Kill Command = /usr/local/hadoop/bin/../bin/hadoop job
> -Dmapred.job.tracker=master:54311 -kill job_201003031204_0080
> 2010-04-01 16:03:54,024 Stage-1 map = 0%,  reduce = 0%
> 2010-04-01 16:04:06,128 Stage-1 map = 100%,  reduce = 0%
> 2010-04-01 16:04:09,150 Stage-1 map = 100%,  reduce = 100%
> Ended Job = job_201003031204_0080
> OK
> NULL    tuesday
> Time taken: 16.981 seconds
>
> Any ideas?
>
> Thanks!
>
> /tom
>

Reply via email to