Skip to content
Advertisement

convert date month year time to date format pyspark

I have a file with timestamp column. When I try to read the file with a schema designed by myself it is populating the datetime column with null.

Source file has data as below

JavaScript

where I am using the below code snippet

JavaScript

in the above DF.display() is showing the result as null for all the inputs. However my expected output is as below:

JavaScript

Advertisement

Answer

You need to provide the date format because the format in the csv file is non-standard.

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement