function - 加入PySpark时有right_anti吗?

标签 function join pyspark parameters apache-spark-sql

查看文档: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.

Join graphs

我知道您可以翻转 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/

相关文章:

apache-spark - 如何从计算机中删除现有的 spark 环境和相关包?

python - 在 pyspark DataFrame 中创建特定类型的空数组列

c++ - 这个 opencv 函数如何在 C++ 中解释

function - Play 2.0 可重用模板功能与 HTML 正文

mysql - 如何将一个表上的 select 获得的所有记录与另一个表的记录连接起来?

mysql - 使用内连接SQL语句时未定义索引

python - PySpark:连接两个 Spark 数据帧时如何将列分组为列表?

C函数的隐式声明

c# - C# 中有函数类型吗?

mysql - 获取非标准化格式的数据库数据