Skip to content

test: Cover Avro compression codecs against fastavro - #4311

Open
chenjian2664 wants to merge 1 commit into
apache:mainfrom
chenjian2664:chenjian2664/bytequay/test-avro-compression-codecs-with-fastavro
Open

chenjian2664 wants to merge 1 commit into
apache:mainfrom
chenjian2664:chenjian2664/bytequay/test-avro-compression-codecs-with-fastavro

Conversation

@chenjian2664

Copy link
Copy Markdown

Rationale for this change

No unit test reads or writes a snappy or bzip2 Avro block. The snappy checksum bug fixed in #2252 made every snappy-compressed Avro file unreadable, and nothing caught it. Exchanging files with fastavro in both directions checks each codec's block framing against an independent implementation of the Avro spec. A test that only compresses and decompresses with PyIceberg would miss a framing error that both sides share.

Are these changes tested?

Are there any user-facing changes?

No unit test read or wrote a snappy or bzip2 Avro block, so a broken
snappy checksum (fixed in apache#2252) went unnoticed. Exchanging files with
fastavro checks each codec's framing against an independent
implementation of the Avro spec.
@chenjian2664
chenjian2664 marked this pull request as ready for review November 9, 2026 04:45
Copilot AI balanced review requested due to automatic review settings November 9, 2026 04:45

Copilot AI 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.

🟢 Approval recommended

There are no active review issues for the added Avro codec interoperability tests.

No open issues 🎉

What changed in this PR

Adds Avro codec interoperability tests against fastavro to help catch block-framing regressions like the snappy checksum bug fixed in #2252.

Changes:

  • Covers null, deflate, bzip2, and snappy codecs.
  • Verifies that PyIceberg reads fastavro-written files and fastavro reads PyIceberg-written files.
  • Checks record contents in both directions and codec metadata on PyIceberg output.
File Description
tests/​avro/​test_file.py Adds parameterized, bidirectional codec interoperability coverage using fastavro.

Review effort: Balanced

This branch has not been deployed

No deployments
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.

2 participants