Re: pyspark sql convert long to timestamp?

2016-03-22 Thread Andy Davidson
Thanks

createdAt is a long

from_unixtime(createdAt / 1000, '-MM-dd HH:mm:ss z') as fromUnix,

Worked


From:  Akhil Das <ak...@sigmoidanalytics.com>
Date:  Monday, March 21, 2016 at 11:56 PM
To:  Andrew Davidson <a...@santacruzintegration.com>
Cc:  "user @spark" <user@spark.apache.org>
Subject:  Re: pyspark sql convert long to timestamp?

> Have a look at the from_unixtime() functions.
> https://spark.apache.org/docs/1.5.0/api/python/_modules/pyspark/sql/functions.
> html#from_unixtime
> 
> Thanks
> Best Regards
> 
> On Tue, Mar 22, 2016 at 4:49 AM, Andy Davidson <a...@santacruzintegration.com>
> wrote:
>> Any idea how I have a col in a data frame that is of type long any idea how I
>> create a column who¹s type is time stamp?
>> 
>> The long is unix epoch in ms
>> 
>> Thanks
>> 
>> Andy
> 




Re: pyspark sql convert long to timestamp?

2016-03-22 Thread Akhil Das
Have a look at the from_unixtime() functions.
https://spark.apache.org/docs/1.5.0/api/python/_modules/pyspark/sql/functions.html#from_unixtime

Thanks
Best Regards

On Tue, Mar 22, 2016 at 4:49 AM, Andy Davidson <
a...@santacruzintegration.com> wrote:

> Any idea how I have a col in a data frame that is of type long any idea
> how I create a column who’s type is time stamp?
>
> The long is unix epoch in ms
>
> Thanks
>
> Andy
>


pyspark sql convert long to timestamp?

2016-03-21 Thread Andy Davidson
Any idea how I have a col in a data frame that is of type long any idea how
I create a column who¹s type is time stamp?

The long is unix epoch in ms

Thanks

Andy