查看文档:https://spark.apache.org/docs/latest/api/python/pyspark.sql.html?highlight=join
“how=”参数有这些选项……:
inner, cross, outer, full, fullouter, full_outer, left, leftouter, left_outer, right, rightouter, right_outer, semi, leftsemi, left_semi, anti, leftanti and left_anti.
我知道您可以翻转 df1 和 df2 并仍然执行 left_anti 以实现 right_anti,但函数参数是否完全缺少 right_anti 还是我缺少/不理解概念?
最佳答案
我认为您没有错过这个概念。在我看来它应该可用,但 right_anti
目前在 Pyspark 中不存在。因此,我建议使用您已经提出的方法:
# Right anti join via 'left_anti' and switching the right and left dataframe.
df = df_right.join(df_left, on=[...], how='left_anti')
关于function - 加入PySpark时有right_anti吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64311964/