0

I'm having issue while trying to inserting new data in Hive external partitioned table.

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:

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!

3
  • probably not the issue, but you have an extra comma after primary_alias_id Commented Oct 26, 2016 at 13:18
  • Was this problem solved ? I am having exact same issue Commented Jun 11, 2019 at 18:24
  • @Confused yes it was, through the answer below. Commented Jun 12, 2019 at 5:51

1 Answer 1

1

I believe you should 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. Which will give other parsing error.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.