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 引起的記錄數不一致。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM