溫馨提示×

hive中怎么設(shè)置執(zhí)行引擎

小億
196
2024-03-28 16:01:14

在Hive中,默認(rèn)情況下使用的是Tez執(zhí)行引擎。但是你可以通過以下方式來設(shè)置不同的執(zhí)行引擎:

  1. 使用Hive CLI或Beeline連接到Hive,然后執(zhí)行以下命令來設(shè)置執(zhí)行引擎為MapReduce:
SET hive.execution.engine=mr;
  1. 使用Hive CLI或Beeline連接到Hive,然后執(zhí)行以下命令來設(shè)置執(zhí)行引擎為Spark:
SET hive.execution.engine=spark;
  1. 在Hive配置文件hive-site.xml中添加以下配置來設(shè)置默認(rèn)執(zhí)行引擎為Tez:
<property>
  <name>hive.execution.engine</name>
  <value>tez</value>
</property>
  1. 在Hive配置文件hive-site.xml中添加以下配置來設(shè)置默認(rèn)執(zhí)行引擎為MapReduce:
<property>
  <name>hive.execution.engine</name>
  <value>mr</value>
</property>

無論你選擇哪種方式設(shè)置執(zhí)行引擎,都可以根據(jù)實(shí)際需求來選擇合適的執(zhí)行引擎。

0