You need to use from_unixtime()
On Tue, Jul 10, 2012 at 1:01 PM, Raihan Jamal <jamalrai...@gmail.com> wrote: > Here timestamps is a string and I always get NULL in the second column when > I try to get date out of the timestamp. Anything wrong I am doing? > > > select A.timestamps, to_date(A.timestamps) from > (select user_id, prod_and_ts.product_id as product_id, > prod_and_ts.timestamps as timestamps from testingtable2 lateral view > explode(purchased_item) exploded_table as prod_and_ts) A; > > > This is the Output I am getting always. > > 1004941621 NULL > 1005268799 NULL > 1061569397 NULL > 1005542471 NULL > > > > Raihan Jamal >