I am using spark 2.1.0. I am not able to create timestamp column in pyspark I am using below code snippet. Please help
df=df.withColumn('Age',lit(datetime.now()))
I am getting
assertion error:col should be Column
Please help
I am using spark 2.1.0. I am not able to create timestamp column in pyspark I am using below code snippet. Please help
df=df.withColumn('Age',lit(datetime.now()))
I am getting
assertion error:col should be Column
Please help
I am not sure for 2.1.0, on 2.2.1 at least you can just:
Hope it helps!
Assuming you have dataframe from your code snippet and you want same timestamp for all your rows.
Let me create some dummy dataframe.
Adding on to balalaika, if someone, like me just want to add the date, but not the time with it, then he can follow the below code
Hope this helps