如何在火花中执行"NOT EXIST statement "



我现在将sql server查询转换为spark。我正面临转换给定查询的问题

and not exists (Select 1 from @TT t2 where t2.TID = f.ID)

我已经做过了,知道spark不支持'not exist'命令我用了except但是error是

pyspark.sql.utils.AnalysisException: u'Except can only be performed on tables with the same number of columns, but the left table has 7 columns and the right has 31;'

我也试过内部连接操作所以except不适用于不均匀列数的表。什么将是一个兼容的备用查询这个查询在spark帮助我吗我使用的是pyspark 2.0

在spark 2.0中,你可以使用"left_anti"加入

相关内容