I have a Spark DataFrame df with five columns. I want to add another column with its values being the tuple of the first and second columns. When u
DataFrame
df
If you want to merge two dataframe columns into one column. Just:
import org.apache.spark.sql.functions.array df.withColumn("NewColumn", array("columnA", "columnB"))