[英]Hive - Insert data into partitioned table: partition not found
I'm having issue while trying to inserting new data in Hive external partitioned table. 尝试在Hive外部分区表中插入新数据时遇到问题。
Table is partitioned by day, the error I got is: 表按天划分,我得到的错误是:
FAILED: SemanticException [Error 10006]: Line 1:51 Partition not found ''18102016''
My query is as following: 我的查询如下:
ALTER TABLE my_source_table RECOVER PARTITIONS;
INSERT OVERWRITE TABLE my_dest_table PARTITION (d = '18102016')
SELECT
'III' AS primary_alias_type,
iii_id AS primary_alias_id,
FROM
my_source_table
WHERE
d = '18102016'
The my_dest_table has been created as: my_dest_table已创建为:
CREATE EXTERNAL TABLE my_dest_table (
primary_alias_type string,
primary_alias_id
) PARTITIONED BY (d string)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
LOCATION 's3://my_bucket/my_external_tables/'
Any idea on what I'm doing wrong? 关于我在做什么错的任何想法吗? Thanks!
谢谢!
I believe you should ALTER TABLE my_source_table RECOVER PARTITIONS;
我相信您应该
ALTER TABLE my_source_table RECOVER PARTITIONS;
do this for your destination table. 为此目的表。
ALTER TABLE my_dest_table RECOVER PARTITIONS;
try this. 尝试这个。
Note: Of course you should remove the extra comma what Alex L mentioned. 注意:当然,您应该删除Alex L提到的多余逗号。 Which will give other parsing error.
这将给其他解析错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.