I have a table with timestamp in string format "1504856248587", I want to convert it into dateformat "2017-09-08". How can i do in using spark-scala API ?
Asked
Active
Viewed 220 times
0
-
cast it to `bigint` and then use `from_unixtime`. – philantrovert Sep 08 '17 at 08:39
-
You can use either from_unixtime or Jodatime. Please refer this [post](https://stackoverflow.com/questions/31134969/how-to-convert-unix-timestamp-to-date-in-spark) – nitinr708 Sep 08 '17 at 08:49