Spark SQL - Select all AND computed columns?
Just do:
df.select(df.col("*"), df.col("colName").plus(1));
You can use withColumn()
method, this will create a new column to the DataFrame.
df.select("*")
.withColumn("ColName", col("colName").plus(1))