且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在spark sql中进行左外连接?

更新时间:2022-10-31 15:57:56

我在您的代码中没有发现任何问题.左连接"或左外连接"都可以正常工作.请再次检查数据,您显示的数据是匹配的.

I don't see any issues in your code. Both "left join" or "left outer join" will work fine. Please check the data again the data you are showing is for matches.

您还可以使用以下方法执行 Spark SQL 联接:

You can also perform Spark SQL join by using:

//显式左外连接

df1.join(df2, df1["col1"] == df2["col1"], "left_outer")