Skip to content

Conversation

yongkyunlee
Copy link
Contributor

@yongkyunlee yongkyunlee commented Aug 23, 2025

Which issue does this PR close?

Rationale for this change

In the original code, the bitmap was modified before decoding. Even if decoding fails, the null buffer was modified, leading to bitmap corruption, eventually causing flush to fail.

What changes are included in this PR?

This PR fixes the bug where the bitmap was modified before decoding. If there is decoding failure, the bitmap should not be modified but the decode method should be exited gracefully without any side effect.

Are these changes tested?

  • Added a unit test

Are there any user-facing changes?

No.

@github-actions github-actions bot added arrow Changes to the arrow crate arrow-avro arrow-avro crate labels Aug 23, 2025
@alamb
Copy link
Contributor

alamb commented Aug 23, 2025

@jecsand838 could you please also review this PR?

@jecsand838
Copy link
Contributor

@yongkyunlee This was a solid catch. Thank you so much for discovering it and getting this PR up. LGTM

@yongkyunlee yongkyunlee changed the title Fix Avro decoder bitmap corruption when nullable field decoding fails [avro] Fix Avro decoder bitmap corruption when nullable field decoding fails Aug 24, 2025
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Tank you @yongkyunlee and @jecsand838

@alamb alamb merged commit c83c6b2 into apache:main Aug 24, 2025
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate arrow-avro arrow-avro crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avro nullable field decode failure leads to panic upon decoder flush
3 participants