在hive的查询中,大部分都会出发一个MapReduce操作,但是在hive中,某些情况可以不必使用MapReduce,也就是所谓的本地操作模式

如图是执行MapReduce的过程。

Hive | Hive可以避免进行MapReduce

 

1.当时用select * from tableName情况下,Hive可以简单的读取table对应的存储目录下的文件,然后输出格式化后的文件到控制台。对于在where条件中使用分区字段这种情况,也是无需MapReduce过程的,例如select * from tableName where partition1=‘’;无论使用limit语句限制记录条数。

2.如果属性hive.exec.mode.local.auto的值设置为true的话,Hive还会尝试使用本地模式执行其他的操作:

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

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

相关文章:

  • 2021-07-14
  • 2021-12-08
  • 2022-12-23
  • 2022-01-22
  • 2021-05-06
  • 2021-08-09
  • 2022-12-23
  • 2021-09-27
猜你喜欢
  • 2021-12-30
  • 2021-09-24
  • 2021-07-01
  • 2021-06-06
  • 2021-05-10
  • 2022-12-23
相关资源
相似解决方案