hive -f /data/crop_process.hql Hive Session ID = 09ab9a98-3eb0-4312-a931-35f15dd12e58 Logging initialized using configuration in jar:file:/apache-hive-3.1.3-bin/lib/hive-common-3.1.3.jar!/hive-log4j2.properties Async: true Hive Session ID = 826efe68-0ac1-4e6f-a61a-cd0149df349d Query returned non-zero code: 1, cause: 'SET hive.execution.engine=local' FAILED in validation : Invalid value.. expects one of [mr, tez, spark]. WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked. WARN: Please see http://www.slf4j.org/codes.html#release for an explanation.

1.如果你仅仅想要使用本地模式

  -- 关闭MapReduce集群模式,强制本地执行

  SET mapreduce.framework.name=local;

  -- 禁用tez/spark,使用本地MapReduce

  SET hive.execution.engine=mr;

  -- 本地执行内存配置(根据服务器调整)

  SET mapreduce.job.maps=1;

  SET mapreduce.job.reduces=1;

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

  -- 自动触发本地模式

  SET hive.exec.mode.local.auto.inputbytes.max=134217728; -- 128MB以内数据本地执行

  SET hive.exec.mode.local.auto.input.files.max=10; -- 文件数少于10个本地执行

2.如果你想要使用集群模式

-- 基础配置(集群模式通用)
SET hive.cli.print.header=true;        -- 显示查询结果表头
SET hive.resultset.use.unique.column.names=false;  -- 表头不显示表名
SET hive.execution.engine=mr;          -- 集群MR引擎

注意:是在文件开头添加这些配置!!!

更多推荐