推荐
hive调优
1 fetch抓取
Fetch抓取是指,Hive中对某些情况的查询可以不必使用MapReduce计算
在hive-default.xml.template文件中hive.fetch.task.conversion默认是more,老版本hive默认是minimal,该属性修改为more以后,在全局查找、字段查找、limit查找等都不走mapreduce。
[hive-site.xml]
<property>
<name>hive.fetch.task.conversion</name>
<value>more</value>
<description>
</property>
2 本地模式
在数据量比较小的时候,为查询触发执行任务消耗的时间可能会比实际job的执行时间要多的多,这时候hive可以通过本地模式在单台机器上处理所有的任务。
//开启本地模式
set hive.exec.mode.local.auto=true;
//设置local mr的最大输入数据量,当输入数据量小于这个值时采用local mr的方式,默认为134217728,即128M
set hive.