更新时间:2023-11-28 18:51:10
在这种情况下,您需要使用 left_anti
连接.
You'll need to use a left_anti
join in this case.
左反连接与左半连接相反.
它根据给定的键从左表中过滤出右表中的数据:
It filters out data from the right table in the left table according to a given key :
largeDataFrame
.join(smallDataFrame, Seq("some_identifier"),"left_anti")
.show
// +---------------+----------+
// |some_identifier|first_name|
// +---------------+----------+
// | 222| mary|
// | 111| bob|
// +---------------+----------+