I want to remove the milli seconds part when selecting the column through spark sql.
Ex: 2012-10-17 13:02:50.320
I want the result as 2012-10-17 13:02:50 I tried
spark.sql("select cast(datecol as timestamp) from table
spark.sql("select unix_timestamp(datecol,"yyyy-MM-dd HH:mm:ss") from table
Both seems not working, substring works but I need timestamp format ,Is there an other way to do it?
Thanks in advance