How to add a string value to a column in pyspark. Using withColumn("status","online") gives error
I'm using Spark 1.6 here
How to add a string value to a column in pyspark. Using withColumn("status","online") gives error
I'm using Spark 1.6 here
A new column can be added like below
df.withColumn("status",df.online)
This can be casted to string type explicitly like below
df.withColumn("status",df.online.cast("String"))