【发布时间】:2015-11-07 00:17:07
【问题描述】:
我有一个 Hive 表,它是通过连接来自多个表的数据创建的。此数据位于一个包含多个文件(“0001_1”、“0001_2”、...等等)的文件夹中。我需要根据该表中名为pt_dt 的日期字段创建一个分区表(通过更改此表或创建一个新表)。有没有办法做到这一点?
我尝试创建一个新表并将其插入(如下),但没有成功
create external table table2 (acct_id bigint, eval_dt string)
partitioned by (pt_dt string);
insert into table2
partition (pt_dt)
select acct_id, eval_dt, pt_dt
from jmx948_variable_summary;
这会引发错误
“失败:执行错误,从 org.apache.hadoop.hive.ql.exec.mr.MapRedTask 返回代码 2 MapReduce 职位发布: Stage-Stage-1:映射:189 累积 CPU:401.68 秒 HDFS 读取:0 HDFS 写入:0 FAIL MapReduce CPU 总耗时:6 分 41 秒 680 毫秒"
【问题讨论】: