Repository navigation
test: Cover Avro compression codecs against fastavro - #4311
Open
chenjian2664 wants to merge 1 commit into
Open
chenjian2664 wants to merge 1 commit into
chenjian2664 wants to merge 1 commit into
Conversation
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.
Contributor
There was a problem hiding this comment.
🟢 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, andsnappycodecs. - 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?