HIVE_PARTITION_SCHEMA_MISMATCH
Asked Answered
T

2

13

I'm getting this error from AWS Athena:

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' in table 'db.app_events' is declared as type 'string', but partition 'xxxxx' declared column 'data.entity_price' as type 'double'.

there is no connection with those fields but it gives an error. Is it a bug or am I missing something?

Tenorio answered 26/9, 2019 at 17:38 Comment(1)
what is the query you are trying to execute?Delate
H
7

Schema is kept at partition level unless you inherit schema from table. See this: https://docs.aws.amazon.com/athena/latest/ug/updates-and-partitions.html

also discussed here as well: How to solve this HIVE_PARTITION_SCHEMA_MISMATCH?

Hartley answered 26/9, 2019 at 21:54 Comment(0)
P
0

ALTER TABLE tableName CHANGE columnName newColumnName type CASCADE;

Petersen answered 26/9, 2021 at 8:20 Comment(1)
Doesn't work in spark-sql 3.4Wedge

© 2022 - 2024 — McMap. All rights reserved.