hql中小文件合并操作

本文探讨了在HQL中遇到的小文件合并问题。当执行一个看似简单的HQL时,发现启动了两个MapReduce作业,而预期只有一个。作者通过启用Hive的debug模式并分析执行计划,对这一现象进行了深入研究。
摘要由CSDN通过智能技术生成

老大昨天发给我一个hql:

create table zx_car_weibo_41_tmp
as 
select * 
from ods_tblog_content 
where  dt  = '20130101' 
 and ((content like '%4C%')  or ( extend like '%4C%')) 
 and ((content like '%雪铁龙%')  or ( extend like '%雪铁龙%'))

让我研究一下为什么这么简单的hql会启动两个mapreduce作业,按理说最多是一个mapreduce加上数据文件move操作就够了,我拿到手之后就着手开始研究,首先拿到执行计划:

STAGE DEPENDENCIES:
  Stage-1 is a root stage
  Stage-4 depends on stages: Stage-1 , consists of Stage-3, Stage-2
  Stage-3
  Stage-0 depends on stages: Stage-3, Stage-2
  Stage-5 depends on stages: Stage-0
  Stage-2

STAGE PLANS:
  Stage: Stage-1
    Map Reduce
      Alias -> Map Operator Tree:
        ods_tblog_content 
          TableScan
            alias: ods_tblog_content
            Filter Operator
              predicate:
                  expr: (((content like '%4C%') or (extend like '%4C%')) and ((content like '%雪铁龙%') or (extend like '%雪铁龙%')))
                  type: boolean
              Filter Operator
                predicate:
                    expr: (((dt = '20130101') and ((content like '%4C%') or (extend like '%4C%'))) and ((content like '%雪铁龙%') or (extend like '%雪铁龙%')))
                    type: boolean
                Select Operator
                  expressions:
                        expr: action
                        type: string
     
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值