【发布时间】:2020-03-20 00:17:17
【问题描述】:
我有两个数据框:
数据框1:
+-----++-----++-------------+
| id || name| has_bank_acc |
+-----++-----++-------------+
| 0|| qwe|| true |
| 1|| asd|| false |
| 2|| rty|| false |
| 3|| tyu|| true |
+-----++-----++-------------+
数据框2:
+-----++-----++--------------+
| id || name| has_email_acc |
+-----++-----++--------------+
| 0|| qwe|| true |
| 5|| hjk|| false |
| 8|| oiu|| false |
| 7|| nmb|| true |
+-----++-----++--------------+
我必须合并这些数据框以获得以下内容:
+-----++-----++-------------++---------------+
| id || name| has_bank_acc || has_email_acc |
+-----++-----++-------------++---------------+
| 0|| qwe|| true | null |
| 1|| asd|| false | null |
| 2|| rty|| false | null |
| 3|| tyu|| true | null |
| 0|| qwe|| null | true |
| 5|| hjk|| null | false |
| 8|| oiu|| null | false |
| 7|| nmb|| null | true |
+-----++-----++-------------+----------------+
我尝试过联合加入,但没有成功
【问题讨论】:
-
合并和加入时遇到什么错误
标签: scala apache-spark