当我尝试将数据插入 hive 中的分区表时,我看到一个错误,这里是详细信息:
桌子:
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;
这是我收到的错误:
失败: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 的以下建议,这是新的更新,但仍然无法正常工作。任何缺失或错误的脚本?