공부
[spark] static column `df.withColumn('new_column', lit(10))`
승가비
2022. 12. 1. 12:56
728x90
https://stackoverflow.com/questions/32788322/how-to-add-a-constant-column-in-a-spark-dataframe
How to add a constant column in a Spark DataFrame?
I want to add a column in a DataFrame with some arbitrary value (that is the same for each row). I get an error when I use withColumn as follows: dt.withColumn('new_column', 10).head(5) ---------...
stackoverflow.com
728x90