Re: Convert timestamp to unix miliseconds

2021-08-07 Thread Artemis User
Apparently you were not using the right formatting string.  For sub-second formatting, use capital S instead of lower case s.  See Spark's doc at https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html. Hope this helps... -- ND On 8/4/21 4:42 PM, Tzahi File wrote: Hi All, I'm

Convert timestamp to unix miliseconds

2021-08-04 Thread Tzahi File
Hi All, I'm using spark 2.4 and trying to convert a timestamp column to unix with milliseconds using the unix_timestamp function. I tried to convert the result to double cast(unix_timestamp(timestamp) as double). I also tried using the timestamp format "-MM-dd HH:mm:ss.sss" and no matter