HIVE_PARTITION_SCHEMA_MISMATCH - Query Id: 7eaf1758-52b0-455f-a67f-87cd42690a44

0

HIVE_PARTITION_SCHEMA_MISMATCH: There is a mismatch between the table and partition schemas. The types are incompatible and cannot be coerced. The column 'id_soggetto' in table 'db_innolva.bilanci' is declared as type 'bigint', but partition 'year=2022/month=05/day=10/hour-minute-second=14-08-18' declared column 'id_soggetto' as type 'double'.

the query ID is 7eaf1758-52b0-455f-a67f-87cd42690a44

thank you

asked 2 years ago484 views
1 Answer
0

Hello,

The error that you re seeing occurs because there is a schema difference between the schema of particular partition and the schema of table defined in your Glue catalog. In Athena, a table and its partitions must use the same data formats but their schemas may differ. When you create a new partition, that partition usually inherits the schema of the table. Over time, the schemas may start to differ. Please do read this documentation that explains the several reasons for the cause of the error.

If in case you have crawler for this table, then please re-run the crawler by setting the option "Update all new and existing partitions with metadata from the table". This should essentially update the schema.

In case the above does not work out then it would be better to drop the corresponding partition and then recreate the partition.

ALTER TABLE DROP PARTITION
ALTER TABLE ADD PARTITION

https://docs.aws.amazon.com/athena/latest/ug/alter-table-drop-partition.html https://docs.aws.amazon.com/athena/latest/ug/alter-table-add-partition.html The above documentations should be able to help you.

profile pictureAWS
SUPPORT ENGINEER
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions