【发布时间】:2019-09-19 00:06:54
【问题描述】:
我们有插入查询,我们试图通过从非分区表中读取数据来将数据插入到分区表中。
查询-
insert into db1.fact_table PARTITION(part_col1, part_col2)
( col1,
col2,
col3,
col4,
col5,
col6,
.
.
.
.
.
.
.
col32
LOAD_DT,
part_col1,
Part_col2 )
select
col1,
col2,
col3,
col4,
col5,
col6,
.
.
.
.
.
.
.
col32,
part_col1,
Part_col2
from db1.main_table WHERE col1=0;
表有 34 列,主表中的记录数取决于我们每天收到的输入文件的大小。 并且我们在每次运行中插入的分区数(part_col1、part_col2)可能从 4000 到 5000 不等
有时此查询会因以下问题而失败。
2019-04-28 13:23:31,715 第一阶段地图 = 95%,减少 = 0%,累积 CPU 177220.23 sec 2019-04-28 13:24:25,989 Stage-1 map = 100%,减少 = 0%,累积 CPU 163577.82 秒 MapReduce 总累积 CPU 时间:1 天 21 小时 26 分 17 秒 820 毫秒结束的作业 = job_1556004136988_155295 with errors 作业期间出错,获取 调试信息... 检查任务 ID: 来自工作的task_1556004136988_155295_m_000003(以及更多) job_1556004136988_155295 检查任务 ID: 来自工作的task_1556004136988_155295_m_000004(以及更多) job_1556004136988_155295 失败次数最多的任务(4): ----- 任务ID:task_1556004136988_155295_m_000000
----- 此任务的诊断消息:容器启动异常。容器编号: container_e81_1556004136988_155295_01_000015 退出代码:255 堆栈 跟踪:ExitCodeException 退出代码 = 255: 在 org.apache.hadoop.util.Shell.runCommand(Shell.java:563) 在 org.apache.hadoop.util.Shell.run(Shell.java:460) 在 org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:748) 在 org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor.launchContainer(LinuxContainerExecutor.java:305) 在 org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:356) 在 org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:88) 在 java.util.concurrent.FutureTask.run(FutureTask.java:266) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 在 java.lang.Thread.run(Thread.java:748) Shell 输出:main:提供的命令 1 main:用户是 bldadmin main: 请求的纱线用户是 bldadmin 容器以非零值退出 退出代码 255 失败:执行错误,从返回代码 2 org.apache.hadoop.hive.ql.exec.mr.MapRedTask MapReduce Jobs Launched: Stage-Stage-1:映射:10 累积 CPU:163577.82 秒 MAPRFS 读取: 0 MAPRFS 写入:0 FAIL 总 MapReduce CPU 时间花费:1 天 21 小时 26 分 17 秒 820 毫秒
当前配置单元属性。
使用 Tez 引擎 -
set hive.execution.engine=tez;
set hive.tez.container.size=3072;
set hive.tez.java.opts=-Xmx1640m;
set hive.vectorized.execution.enabled=false;
set hive.vectorized.execution.reduce.enabled=false;
set hive.enforce.bucketing=true;
set hive.exec.parallel=true;
set hive.auto.convert.join=false;
set hive.enforce.bucketmapjoin=true;
set hive.optimize.bucketmapjoin.sortedmerge=true;
set hive.optimize.bucketmapjoin=true;
set hive.exec.tmp.maprfsvolume=false;
set hive.exec.dynamic.partition.mode=nonstrict;
set hive.exec.dynamic.partition=true;
set hive.stats.fetch.partition.stats=true;
set hive.support.concurrency=true;
set hive.exec.max.dynamic.partitions=999999999;
set hive.enforce.bucketing=true;
set hive.exec.dynamic.partition.mode=nonstrict;
set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
set hive.compactor.initiator.on=true;
根据其他团队的意见,我们将引擎更改为 mr 并且属性是 -
set hive.execution.engine=mr;
set hive.auto.convert.join=false;
set mapreduce.map.memory.mb=16384;
set mapreduce.map.java.opts=-Xmx14745m;
set mapreduce.reduce.memory.mb=16384;
set mapreduce.reduce.java.opts=-Xmx14745m;
这些属性查询完成几次,没有任何错误。
我如何调试这些问题,是否有任何我们可以设置的配置单元属性,以便我们以后不会遇到这些问题。
【问题讨论】:
标签: hive insert hiveql partition hive-partitions