Skip to content

fix: accept legacy Athena field names in manifest list parsing#369

Open
JanKaul wants to merge 2 commits into
mainfrom
fix-legacy-athena-manifest-field-names
Open

fix: accept legacy Athena field names in manifest list parsing#369
JanKaul wants to merge 2 commits into
mainfrom
fix-legacy-athena-manifest-field-names

Conversation

@JanKaul

@JanKaul JanKaul commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • AWS Athena (and possibly other engines) writes added_data_files_count, existing_data_files_count, and deleted_data_files_count in manifest list files instead of the spec-correct names — a known early misalignment tracked in apache/iceberg#8684
  • Reading such files failed with Missing field in record: "added_files_count" because apache_avro performs Avro-level field resolution by name when a reader schema is supplied, and avro-rs has no alias support
  • Fix: read without a reader schema (using the embedded writer schema) so the raw field names reach the serde layer, then use #[serde(alias)] to accept both the legacy and spec-correct names on all three affected fields across V1/V2/V3 serde structs
  • A TODO comment marks the reader-schema removal as temporary — to be reverted once all major query engines write the spec-correct names

Fixes #367

Test plan

  • Existing test_manifest_list_v1/v2/v3 unit tests pass
  • Manually verify reading a manifest list written by Athena resolves without error

🤖 Generated with Claude Code

JanKaul and others added 2 commits July 2, 2026 17:42
Some query engines (e.g. AWS Athena) write `added_data_files_count`,
`existing_data_files_count`, and `deleted_data_files_count` instead of
the spec-correct `added_files_count` etc. (apache/iceberg#8684).

Supplying a reader schema to apache_avro triggers Avro-level field
resolution by name, which fails silently for these files because
avro-rs has no alias support. We now read without a reader schema so
the embedded writer field names reach the serde layer, where
`#[serde(alias)]` maps both legacy and canonical names correctly.

Fixes #367

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@gruuya gruuya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will work, we'd love to try it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Robust Avro schema parsing

2 participants