I have a timestamp in the below format. How to get date in yyyy-MM-dd format from it?
+-------------------------+
|15APR2021:03:53:54.458387|
|15APR2021:03:53:53.830339|
|15APR2021:03:53:54.297856|
+-------------------------+
I have tried using the below but is getting null.
scala> spark.sql("select to_date('15APR2021:03:53:54.297856')").show()
+------------------------------------+
|to_date('15APR2021:03:53:54.297856')|
+------------------------------------+
| null|
+------------------------------------+