我有一個數據幀加薪,我想增加對其他一些COLUMN1分組每一行new_col=max(some_column0)
:火花加入「檢測到笛卡爾乘積爲INNER JOIN」
maxs = df0.groupBy("catalog").agg(max("row_num").alias("max_num")).withColumnRenamed("catalog", "catalogid")
df0.join(maxs, df0.catalog == maxs.catalogid).take(4)
而在第二個字符串我得到一個錯誤:
AnalysisException: u'Detected cartesian product for INNER join between logical plans\nProject ... Use the CROSS JOIN syntax to allow cartesian products between these relations.;'
我不明白:爲什麼火花在這裏找到笛卡爾產品?
可能出現此錯誤的方法:我將DF保存到Hive表中,然後再次從表中選擇init DF。或者將這兩個字符串替換爲配置單元查詢 - 無論如何。但我不想保存DF。