fix: handle Avro reader schema with no fields#9611
Open
mzabaluev wants to merge 3 commits intoapache:mainfrom
Open
fix: handle Avro reader schema with no fields#9611mzabaluev wants to merge 3 commits intoapache:mainfrom
mzabaluev wants to merge 3 commits intoapache:mainfrom
Conversation
In the degenerate case when the Avro reader schema has no fields, the RecordDecoder should be able to produce empty record batches with the number of rows counted from the data.
In arrow-avro. Since the async reader only reads OCF files and uses decode_block to decode, use flush_block for consistency and to avoid unnecessary checks.
f8a3f4a to
c518a19
Compare
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.
Which issue does this PR close?
Rationale for this change
In the degenerate case when the Avro reader schema has no fields, the
RecordDecodershould be able to produce empty record batches with the number of rows counted from the data. As an optimization for OCF, the reader could skip decoding altogether, relying on record counts provided by data blocks.What changes are included in this PR?
A row counter is run in the
RecordDecoderstate.Are these changes tested?
Added tests to verify decoder behavior given an empty reader schema for the data files in the test suite.
Are there any user-facing changes?
No.