当我尝试将数据插入配置单元中的分区表时,我发现错误,这是详细信息:
表格:
CREATE TABLE partitionedemp(emp_no int, birth_date string, first_name string, last_name string) Partitioned By(gender string, hire_date string) stored as sequencefile;
插入脚本:
insert into table partitionedemp partition(gender, hire_date) select emp_no, birth_date, first_name, last_name, gender, hire_date from emp;
以下是我收到的错误:
FAILED:SemanticException [错误10096]:动态分区严格模式至少需要一个静态分区列。要关闭它,请设置hive.exec.dynamic.partition.mode = nonstrict
我首先通过执行以下两行来跟踪一些在线建议:
SET hive.exec.dynamic.partition = true;
SET hive.exec.dynamic.partition.mode = nonstrict;
最后它说:
FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
MapReduce Jobs Launched:
Stage-Stage-1: Map: 1 Cumulative CPU: 14.39 sec HDFS Read: 0 HDFS Write: 0 FAIL
Total MapReduce CPU Time Spent: 14 seconds 390 msec
更新:我按照@leftjoin的建议,这是新的更新,仍然无法正常工作。任何缺失或错误的脚本?
答案 0 :(得分:0)
按照异常消息中的建议并增加这些值:
例如
set hive.exec.max.dynamic.partitions=100000;
set hive.exec.max.dynamic.partitions.pernode=10000;
我建议你尽可能减少分区数量。删除性别,会减少分区数量。对于hadoop来说,太多小文件不是好主意