[Hive]调用本地模式,避免使用MapReduce

大多数情况下查询都会触发一个MapReduce任务(job)。Hive中对于某些查询可以不必使用MapReduce,也就是所谓的本地模式,例如:

SELECT * FROM employees
WHERE country = 'US' and state = 'CA'
LIMIT 100;

通过修改属性的值,Hive还是尝试使用本地模式执行其他的操作:

set hive.exec.mode.local.auto=true;

最好将set hive.exec.mode.local.auto=true; 这个设置增加到你的$HOME/.hiverc配置文件中。

猜你喜欢

转载自blog.csdn.net/TOMOCAT/article/details/81674546