spark做表连接的时候出现这个错误,
Exception in thread "main" org.apache.spark.sql.AnalysisException: Detected cartesian product for LEFT OUTER join between logical plans LocalLimit 21
出现错误,这时,需要添加
spark.conf.set("spark.sql.crossJoin.enabled", "true")
再次运行,可以成功。
因为 ,2.x中默认不支持笛卡尔积操作,需要通过参数spark.sql.crossJoin.enabled
开启