hive插入数据报code1、code3

code1

SQL语句:

insert overwrite table `demo.run_peak_kpi_inc1` partition (dt)
select elevator_id, unit_guid, peak_flag, peak_range_time, peak_run_num, peak_time, peak_run_time, peak_run_rate, peak_crowding,
       peak_call_wait_avg_time, relative_peak_range_time, relative_peak_run_num, peak_ride_elevator_time, total_run_num, sum_run_time5, dt
from demo.run_peak_kpi_inc where dt in('20240918','20240924')

报错信息:

[08S01][1] Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask. Exception when loading 2 in table run_peak_kpi_inc1 with loadPath=hdfs://test-bigdata-01:8020/user/hive/warehouse/demo.db/run_peak_kpi_inc1/.hive-staging_hive_2024-11-06_15-59-58_719_3512888189699090378-907/-ext-10000

原因:

在hdfs上删除了分区,但表未删除分区,在插入时就会导致无法清理该分区信息,进行重新创建分区

解决办法:

1.查看分区,保持hdfs和表分区信息一致

2.分区字段加在查询末尾

show partitions demo.run_peak_kpi_inc1;
ALTER TABLE demo.run_peak_kpi_inc1 DROP PARTITION (dt='20240918');

code3 

解决办法:

1. 设置 hive.exec.max.dynamic.partitions
     含义:这个参数控制了整个查询中允许的最大动态分区数。

2. 设置 hive.exec.max.dynamic.partitions.pernode
      含义:这个参数控制了每个节点上允许的最大动态分区数。

set hive.exec.max.dynamic.partitions=50000;
set hive.exec.max.dynamic.partitions.pernode=10000;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值