zoukankan      html  css  js  c++  java
  • hive sql 语句执行顺序及执行计划

    hive 语句执行顺序

    from... where.... select...group by... having ... order by...
    

    执行计划

    Map Operator Tree:
    TableScan
                alias: 表名   -- 相当于 from ...
    
    Filter Operator
                  predicate: where中的字段  -- 过滤where字段的条件
    
    Select Operator
                    expressions: select 中的字段 + 类型type    -- select
                    outputColumnNames: 输出的字段  -- select
    Group By Operator
                      aggregations: 聚合函数 sum(age)/count(age)等 
                      keys: group by 中的字段 + 类型type 
    Reduce Output Operator
                     map端本地的reduce
    
    Reduce Operator Tree:
    Group By Operator
              aggregations: sum(VALUE._col0)   --reduce 聚合函数 对虚拟列
              keys: KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: string) 
              mode: mergepartial
                  outputColumnNames: _col0, _col1, _col2, _col3 --为临时结果字段按规则起的临时字段名
    Select Operator
                expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: bigint) --select
                outputColumnNames: _col0, _col1, _col2, _col3 -- 输出虚拟列(为临时结果字段按规则起的临时字段名)
                
    File Output Operator
                  compressed: false
                  
    

    未完待续

  • 相关阅读:
    第十次作业
    第九次作业总结
    第九次作业
    第八次作业总结
    第七次作业总结
    第六次总结
    第十二次作业总结
    第十一次作业总结
    第十次作业总结
    第九次作业总结
  • 原文地址:https://www.cnblogs.com/jiangxiaoxian/p/7155636.html
Copyright © 2011-2022 走看看