我有一个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;
Run Code Online (Sandbox Code Playgroud)
这引发错误
“失败:执行错误,从org.apache.hadoop.hive.ql.exec.mr.MapRedTask返回Map 2,启动MapReduce作业:Stage-Stage-1:Map:189累积CPU:401.68 sec HDFS读取:0 HDFS写入: 0 FAIL MapReduce花费的总CPU时间:6分41秒680毫秒”