在 Hive 中启动 MapReduce 作业的标准

Criterion for MapReduce jobs getting launched in Hive

我是 Hadoop 的新手,所以请帮我解决这个基本问题。

当我在 Hive 中执行 "select * from table where <condition>;" 时,我知道它将启动 mapreduce,因为它需要对底层 HDFS 文件应用过滤。

但是当我在 Hive 上没有任何 where 子句的情况下执行 select * from table 时,有时会启动 mapreduce,有时不会。我的理解是,理想情况下它不应该启动 mapreduce,因为没有过滤条件。

有人可以解释一下为什么在少数情况下 mapreduce 会在 Hive 上启动吗?

提前致谢。

这由两个 Hive 属性控制

  • hive.fetch.task.conversion
  • hive.fetch.task.conversion.threshold

hive.fetch.task.conversion 未设置为 none 时,简单的 SELECT 查询将执行提取任务而不是 mapreduce 任务。

但是如果table中的文件总大小超过hive.fetch.task.conversion.threshold中设置的字节阈值,则会触发mapreduce任务。

在 Hive-0.14.0 及更高版本中,hive.fetch.task.conversion.threshold 的默认值为 1073741824 字节 (1GB)。