hive執行報錯:Both left and right aliases encountered in JOIN 's1'

原因:兩個表join的時候,不支持兩個表的字段 非相等 操作。

可以把不相等條件拿到 where語句中。

例如:
right JOIN test.dim_month_date p2                                                                                       
   on p1.month=p2.y_month and p1.day<=p2.day

可以改寫成
right JOIN test.dim_month_date_zyy p2                                                                                       
   on p1.month=p2.y_month 
where p1.day<=p2.day

當然此時要注意 null 引起的記錄數不一致。

轉自:hive執行報錯:Both left and right aliases encountered in JOIN 's1'

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章