【问题标题】:left join in hive离开加入蜂巢
【发布时间】:2020-02-04 22:29:44
【问题描述】:

有人愿意回答下面的问题吗?

hive 中是左连接外连接还是内连接?

(我们是否需要输入 left "outer" join 来进行外连接?还是干脆 left join 用作外连接?)

【问题讨论】:

    标签: sql join hive left-join


    【解决方案1】:

    就像在大多数(如果不是全部)数据库中一样,outer 词在 left [outer] join 中是可选的,而两种语法具有完全相同的含义。

    快速浏览the hive documentation

    Hive 支持以下连接表的语法:

    join_table:
        table_reference [INNER] JOIN table_factor [join_condition]   
      | table_reference {LEFT|RIGHT|FULL} [OUTER] JOIN table_reference join_condition   
      | table_reference LEFT SEMI JOIN table_reference join_condition   
      | table_reference CROSS JOIN table_reference [join_condition] (as of Hive 0.10)
    

    【讨论】:

      【解决方案2】:

      以下在(几乎)所有数据库中是等效的:

      • INNER JOINJOIN
      • LEFT OUTER JOINLEFT JOIN
      • RIGHT OUTER JOINRIGHT JOIN
      • FULL OUTER JOINFULL JOIN

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-02-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-10-05
        • 1970-01-01
        相关资源
        最近更新 更多