agent's cost-and-usage Athena query failed with "HIVE_PARTITION_SCHEMA_MISMATCH"
Fixes an Athena HIVE_PARTITION_SCHEMA_MISMATCH on CUR data by aligning the table schema with the actual partition files. Use when Athena queries against the Cost and Usage Report fail with a partition schema mismatch. Not for missing-table errors.
TL;DR
The CUR files in different partitions have different schemas (AWS adds columns over time), and Athena refuses to read partitions whose schema differs from the table definition. Update the Athena table definition to the newest CUR schema (or use the AWS-provided CUR table setup), and consider enabling schema evolution handling. The data is fine; the table definition is behind.
Error
agent's cost-and-usage Athena query failed with "HIVE_PARTITION_SCHEMA_MISMATCH"Steps
- Confirm the mismatch: run a simple select on the table and note the HIVEPARTITIONSCHEMA_MISMATCH error. Expected: the error names the partition and column conflict.
- Check the CUR report's current column set in S3 (newer months have more columns than older ones). Expected: the schema drift across partitions is visible.
- Recreate or alter the Athena table using the latest CUR schema definition from the AWS documentation or the CUR setup templates. Expected: the table definition matches the newest files.
- If older partitions still mismatch, use schema-evolution-tolerant settings or partition the table so old and new schemas are queried consistently. Expected: queries run across all partitions.
- Re-run the agent's Athena query. Expected: the query completes and returns cost data.
When to use
- Athena CUR queries fail with HIVEPARTITIONSCHEMA_MISMATCH.
- The CUR report recently gained new columns.
- The Athena table was created long ago and never updated.
When not to use
- The table does not exist (a setup problem).
- The query fails on permissions (an IAM problem).
- The CUR files themselves are missing from S3.
Tool compatibility
AWS Athena with Cost and Usage Reports (current 2026 releases). Applies to CUR query pipelines.
Variant phrasings
athena "partition schema mismatch" on billing data
Update the table definition to the current CUR schema.
cur queries broke after new columns appeared
AWS evolves the CUR schema. Refresh the table definition.
old athena table can't read new cur files
Recreate the table from the latest schema template.
Why it happens
AWS adds columns to the Cost and Usage Report over time (new services, new pricing dimensions), so partitions from different months legitimately have different schemas. Athena's default behavior requires partition schemas to match the table definition, and an old table definition fails on new partitions. Keeping the table definition in sync with the CUR schema is ongoing maintenance, not a one-time setup.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_OEsCwqlhhN8B6McFHUEOdg