美文网首页
HIVE 调优—— hive.fetch.task.conver

HIVE 调优—— hive.fetch.task.conver

作者: Q以梦为马 | 来源:发表于2020-09-01 16:22 被阅读0次

Fetch 抓取是指,Hive 中对某些情况的查询可以不必使用 MapReduce 计算。

启用 MapReduce Job 是会消耗系统开销的。对于这个问题,从 Hive0.10.0 版本开始,对于简单的不需要聚合的类似 select <col> from <table> limit n语句,不需要起 MapReduce job,直接通过 Fetch task 获取数据。

比如:select * from user_table;在这种情况下,Hive 可以简单地读取 user_table 对应的存储目录下的文件,然后输出查询结果到控制台。

hive-default.xml.template 文件中hive.fetch.task.conversion默认是 more,老版本 hive 默认是 minimal,该属性修改为 more 以后,在全局查找、字段查找、limit 查找等都不走 MapReduce。

<property>
    <name>hive.fetch.task.conversion</name>
    <value>more</value>
    <description>
      Expects one of [none, minimal, more].
      Some select queries can be converted to single FETCH task minimizing latency.
      Currently the query should be single sourced not having any subquery and should not have
      any aggregations or distincts (which incurs RS), lateral views and joins.
      0. none : disable hive.fetch.task.conversion
      1. minimal : SELECT STAR, FILTER on partition columns, LIMIT only
      2. more  : SELECT, FILTER, LIMIT only (support TABLESAMPLE and virtual columns)
    </description>
  </property>

1)把hive.fetch.task.conversion设置成none,然后执行查询语句,都会执行mapreduce程序。

hive (default)> set hive.fetch.task.conversion=none;
hive (default)> select * from emp;
hive (default)> select ename from emp;
hive (default)> select ename from emp limit 3;
Time taken: 18.203 seconds, Fetched: 14 row(s)

2)把hive.fetch.task.conversion设置成more,然后执行查询语句,如下查询方式都不会执行mapreduce程序。

hive (default)> set hive.fetch.task.conversion=more;
hive (default)> select * from emp;
hive (default)> select ename from emp;
hive (default)> select ename from emp limit 3;
Time taken: 0.09 seconds, Fetched: 3 row(s)

相关文章

  • HIVE 调优—— hive.fetch.task.conver

    Fetch 抓取是指,Hive 中对某些情况的查询可以不必使用 MapReduce 计算。 启用 MapReduc...

  • Hive 调优总结,让 Hive 调优想法不再碎片化

    通过阅读比较多的 Hive 调优材料,并根据自己的实践,总结 Hive 调优如下,让 Hive 调优想法不再凌乱、...

  • hive调优实战系列文章-hive调优和问题排查思路

    本文将介绍Hive调优的整体过程,以及本人对Hive调优过程的一些思考,包括Hive调优的一般步骤,和调优方法。 ...

  • Hive ETL 优化(参数篇)

    Hive 调优-参数篇 <** 工作中常用的 hive 参数调优,整理如下。 原则: 最少数据 最少字段 最少Jo...

  • hive调优

    1,参数调优 hive.map.aggr = true hive.groupby.skewindata =tr...

  • Hive调优

    1.使用explain 和 explain extended 2.限制调整 limit 在使用Limit 时只输...

  • Hive 调优

    列出调优参数列表 具体可参考https://www.cnblogs.com/xd502djj/p/3799432....

  • Hive调优

    Fetch抓取(Hive可以避免进行MapReduce)Hive中对某些情况的查询可以不必使用MapReduce计...

  • HIVE 调优

    1. Fetch抓取 Fetch抓取是指,Hive中对某些情况的查询可以不必使用MapReduce计算。例如:SE...

  • Hive调优

    1、Fetch 抓取 Fetch 抓取是指,Hive 中对某些情况的查询可以不必使用 MapReduce 计算。例...

网友评论

      本文标题:HIVE 调优—— hive.fetch.task.conver

      本文链接:https://www.haomeiwen.com/subject/bqvvsktx.html