Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Duplicate
-
1.6.1
-
None
-
None
Description
It is common to add column(s) from other DataFrame(s) as follows. However, current withColumn() function only supports appending a new column from the same DataFrame.
val df1 = sc.makeRDD(1 to 5).toDF("a") val df2 = sc.makeRDD(10 to 15).toDF("b") val df = df1.withColumn("b", df2("b")) // Exception
Exception in thread "main" org.apache.spark.sql.AnalysisException: resolved attribute(s) b#3 missing from a#1 in operator !Project a#1,b#3 AS b#4;
Attachments
Issue Links
- duplicates
-
SPARK-7460 Provide DataFrame.zip (analog of RDD.zip) to merge two data frames
- Closed