什么情况下hive可以避免使用mapreduce
select * from employees;
在这种情况下可以简单的读取employees对应的存储目录下的文件,然后输出到格式化后的内容到控制台
对于where语句中的过滤条件只是分区字段这种情况(无论是否使用Limit语句限制输出记录数),也无需mapreduce过程的
select * from employees where country='US' and state='CA' LIMIT 10;
此外,如果属性hive.exec.mode.local.auto的值设置为ture的话,hive还会尝试使用本地模式执行其他操作:
set hive.exec.mode.local.auto=ture;
否则,hive使用mapreduce来执行其他所有的查询
最好将set hive.exec.mode.local.auto=ture;这个设置增加到你的$HOME/.hiverc配置文件中