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
                  
    

    未完待续

  • 相关阅读:
    Day2 三级菜单
    python 练习之购物车
    Day1 登录接口脚本 login.py
    第十周学习进度
    浪潮之巅阅读笔记三
    浪潮之巅阅读笔记二
    浪潮之巅阅读笔记一
    第九周学习进度
    构建执法阅读笔记六
    构建之法阅读笔记五
  • 原文地址:https://www.cnblogs.com/jiangxiaoxian/p/7155636.html
Copyright © 2011-2022 走看看