I have data frame with 5 column his name is: A,B,C,D,E . I want to dataframe with 6 column, F,A,B,C,D,E.
How I can make this?
I have data frame with 5 column his name is: A,B,C,D,E . I want to dataframe with 6 column, F,A,B,C,D,E.
How I can make this?
Column order shouldn’t be important, but if it is you can:
withColumn()
val df2 = dataFrame
.withColumn("F", lit("foo"))
.select("F", "A", "B", "C", "D", "E")
cheers,
Dinko