我有两个表,我只想从源表中读取唯一的记录这两个表都有空值。
source table:
name| age| degree| dept
aaa | 20| ece |null
bbb |20 |it |null
ccc |30 |mech| null
target table
name| age |degree |dept
aaa |20| ece |null
bbb |20 |it| null
soruce_df.join(目标_df,seq(“name”,“age”,“degree”),“leftanti”)->工作
soruce_df.join(target_df,seq(“name”,“age”,“degree”,“dept”),“leftanti”)->不工作
Now i need to pick only 3rd record from source ,
If i use name ,age ,degree as my joining key , it's working as expected
But when i include dept it's picking all the records from source table.
Please help me.
1条答案
按热度按时间ikfrs5lh1#
进行对空值安全的相等性测试。
在python中,替换
<=>
带方法调用eqNullSafe
如下样品-