亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

left join 執行計劃

標簽:
Java
explain select s.id, s.name from student s left outer join student_tmp st on s.name = st.name;
STAGE DEPENDENCIES: “这个sql将被分成两个阶段执行。基本上每个阶段会对应一个mapreduce job,Stage-0除外。因为Stage-0只是fetch结果集,不需要mapreduce job”
  Stage-1 is a root stage
  Stage-0 is a root stage
STAGE PLANS:
  Stage: Stage-1
    Map Reduce
      Alias -> Map Operator Tree: “map job开始”
        s
          TableScan
            alias: s “扫描表student”
            Reduce Output Operator “这里描述map的输出,也就是reduce的输入。比如key,partition,sort等信息。”
              key expressions: “reduce job的key”
                    expr: name
                    type: string
              sort order: + “这里表示按一个字段排序,如果是按两个字段排序,那么就会有两个+(++),更多以此类推”
              Map-reduce partition columns: “partition的信息,由此也可以看出hive在join的时候会以join on后的列作为partition的列,以保证具有相同此列的值的行被分到同一个reduce中去”
                    expr: name
                    type: string
              tag: 0 “用于标示这个扫描的结果,后面的join会用到它”
              value expressions: “表示select 后面的列”
                    expr: id
                    type: int
                    expr: name
                    type: string
        st
          TableScan “开始扫描第二张表,和上面的一样”
            alias: st
            Reduce Output Operator
              key expressions:
                    expr: name
                    type: string
              sort order: +
              Map-reduce partition columns:
                    expr: name
                    type: string
              tag: 1
      Reduce Operator Tree: “reduce job开始”
        Join Operator
          condition map:
               Left Outer Join0 to 1 “tag 0 out join tag 1”
          condition expressions: “这里也是描述select 后的列,和join没有关系。这里我们的select后的列是 s.id 和 s.name, 所以0后面有两个字段, 1后面没有”
{VALUE._col0} {VALUE._col2}
          handleSkewJoin: false
          outputColumnNames: _col0, _col2
          Select Operator
            expressions:
                  expr: _col0
                  type: int
                  expr: _col2
                  type: string
            outputColumnNames: _col0, _col1
            File Output Operator
              compressed: false
              GlobalTableId: 0
              table:
                  input format: org.apache.hadoop.mapred.TextInputFormat
                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
  Stage: Stage-0
    Fetch Operator
      limit: -1
Time taken: 0.216 seconds



作者:scandly
链接:https://www.jianshu.com/p/47a3a47b7929


點擊查看更多內容
TA 點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優質文章

正在加載中
  • 推薦
  • 評論
  • 收藏
  • 共同學習,寫下你的評論
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦
今天注冊有機會得

100積分直接送

付費專欄免費學

大額優惠券免費領

立即參與 放棄機會
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號

舉報

0/150
提交
取消