My data:
[Row(ID=2887628, Date_Time='11/01/2019 05:00:00 PM'),
My code:
from pyspark.sql import functions as F
df = df.withColumn('Date_Time',F.to_date(F.unix_timestamp('Date_Time', 'MM/dd/yyyy HH:mm:ss a').cast('timestamp')))
But the answer of Date_Time is wrong:
[Row(ID=2887628, Date_Time=None),
What's the problem here?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…