I have to add multiple column to the existing dataframe without any static value. I tried with withColumn dataframe.withColumn(c,col(c)) but I have more than 10 columns to add. How can I do that ?
-
what will be the values for those columns ?Suresh– Suresh2017-03-20 07:21:32 +00:00Commented Mar 20, 2017 at 7:21
-
Seq(col1,col2,col3 ... col10).foldLeft(ds)((acc,c) => acc.withColumn(c,col(c)))???Andrzej Jozwik– Andrzej Jozwik2017-03-20 09:01:10 +00:00Commented Mar 20, 2017 at 9:01
-
Yes @AndrzejJozwik I am looking something like that.sks– sks2017-03-20 09:44:20 +00:00Commented Mar 20, 2017 at 9:44
Add a comment
|