I have a sparksql dateframe with dates in the following format: "26MAR2015". In following question they use the to_date function with java simpledataformat: Convert date from String to Date format in Dataframes to convert the strings in date. I could not find more information about this format in following question: Convert pyspark string to date format.
I do not find the correct format for my case:
spark.sql("""
SELECT TO_DATE(CAST(UNIX_TIMESTAMP('15MAR2015', '??????') AS TIMESTAMP)) AS newdate"""
).show()
ddMMMyyyy
and then this is a possible duplicate of Convert pyspark string to date format – pault