Repository navigation
fix(arrow-avro): decode records with no fields - #10771
Merged
Merged
Conversation
Jefffrey
reviewed
Aug 21, 2026
| Vec<Decoder>, | ||
| Vec<Option<AvroLiteral>>, | ||
| Option<Projector>, | ||
| usize, |
Contributor
There was a problem hiding this comment.
perhaps we should name the fields, now that we have many fields
Record {
fields: Fields,
decoders: Vec<Decoder>,
defaults: Vec<Option<AvroLiteral>>,
projector: Option<Projector>,
/// Useful when there are no fields (legal edge case)
row_count: usize
}
Contributor
Author
There was a problem hiding this comment.
thanks for the review! The fields are now named.
added 2 commits
September 1, 2026 22:11
An Avro record with no fields is legal, and encodes to zero bytes. The
reader accepts such a schema and decodes its (empty) bytes fine, but
fails at flush:
Invalid argument error: use StructArray::try_new_with_length or
StructArray::new_empty_fields to create a struct array with no
fields so that the length can be set correctly
`Decoder::Record` flushes through `StructArray::try_new`, which infers
its length from the first child array, but a zero-field record has no
child array.
`RecordDecoder::flush` (the top level) already handles this: it passes
its own `row_count` through `RecordBatchOptions::with_row_count`. This
change gives the nested case the same treatment. `Decoder::Record`
now carries a row count, incremented wherever a row is appended and
reset at `flush`.
sqd
force-pushed
the
avro-empty-record-decode
branch
from
September 1, 2026 21:14
b183083 to
64a6625
Compare
Jefffrey
approved these changes
Sep 2, 2026
Contributor
|
thanks @sqd |
Rich-T-kid
pushed a commit
to Rich-T-kid/arrow-rs
that referenced
this pull request
Sep 18, 2026
An Avro record with no fields is legal, and encodes to zero bytes. The
reader accepts such a schema and decodes its (empty) bytes fine, but
fails at flush:
Invalid argument error: use StructArray::try_new_with_length or
StructArray::new_empty_fields to create a struct array with no
fields so that the length can be set correctly
`Decoder::Record` flushes through `StructArray::try_new`, which infers
its length from the first child array, but a zero-field record has no
child array.
`RecordDecoder::flush` (the top level) already handles this: it passes
its own `row_count` through `RecordBatchOptions::with_row_count`. This
change gives the nested case the same treatment. `Decoder::Record` now
carries a row count, incremented wherever a row is appended and reset at
`flush`.
# Which issue does this PR close?
- Closes apache#10770.
# Are these changes tested?
See included tests.
# Are there any user-facing changes?
No
---------
Co-authored-by: Han You <[email protected]>
Rich-T-kid
pushed a commit
to Rich-T-kid/arrow-rs
that referenced
this pull request
Sep 21, 2026
An Avro record with no fields is legal, and encodes to zero bytes. The
reader accepts such a schema and decodes its (empty) bytes fine, but
fails at flush:
Invalid argument error: use StructArray::try_new_with_length or
StructArray::new_empty_fields to create a struct array with no
fields so that the length can be set correctly
`Decoder::Record` flushes through `StructArray::try_new`, which infers
its length from the first child array, but a zero-field record has no
child array.
`RecordDecoder::flush` (the top level) already handles this: it passes
its own `row_count` through `RecordBatchOptions::with_row_count`. This
change gives the nested case the same treatment. `Decoder::Record` now
carries a row count, incremented wherever a row is appended and reset at
`flush`.
# Which issue does this PR close?
- Closes apache#10770.
# Are these changes tested?
See included tests.
# Are there any user-facing changes?
No
---------
Co-authored-by: Han You <[email protected]>
Rich-T-kid
pushed a commit
to Rich-T-kid/arrow-rs
that referenced
this pull request
Sep 25, 2026
An Avro record with no fields is legal, and encodes to zero bytes. The
reader accepts such a schema and decodes its (empty) bytes fine, but
fails at flush:
Invalid argument error: use StructArray::try_new_with_length or
StructArray::new_empty_fields to create a struct array with no
fields so that the length can be set correctly
`Decoder::Record` flushes through `StructArray::try_new`, which infers
its length from the first child array, but a zero-field record has no
child array.
`RecordDecoder::flush` (the top level) already handles this: it passes
its own `row_count` through `RecordBatchOptions::with_row_count`. This
change gives the nested case the same treatment. `Decoder::Record` now
carries a row count, incremented wherever a row is appended and reset at
`flush`.
# Which issue does this PR close?
- Closes apache#10770.
# Are these changes tested?
See included tests.
# Are there any user-facing changes?
No
---------
Co-authored-by: Han You <[email protected]>
This was referenced Oct 10, 2026
kevinjqliu
added a commit
to mbutrovich/iceberg-rust
that referenced
this pull request
Nov 13, 2026
…ty records arrow-avro 60 decodes records with no fields (apache/arrow-rs#10771), so the entry reader no longer projects out the empty partition of unpartitioned manifests. It now reads the header from its own reader instead of a separate borrowing one. Co-authored-by: Copilot App <[email protected]>
TNB-AR
pushed a commit
to TNB-AR/iceberg-rust
that referenced
this pull request
Nov 19, 2026
…hReaders (apache#3652) * feat(python): read manifests and manifest lists as pyarrow RecordBatchReaders * docs(python): document raised errors and input release for the Arrow readers * Address review feedback on the Arrow manifest readers - Drop the unused manifest_length, partition_spec_id, and min_sequence_number arguments from read_manifest_entries_as_arrow. - Share decoding, projection, and stop-after-error between the two readers through a private ProjectingReader. - Restore the original schema wording in the reader docs. - Check for multiple batches instead of the batch size constant in the Python test. Co-authored-by: Copilot App <[email protected]> * Remove the empty partition workaround now that arrow-avro decodes empty records arrow-avro 60 decodes records with no fields (apache/arrow-rs#10771), so the entry reader no longer projects out the empty partition of unpartitioned manifests. It now reads the header from its own reader instead of a separate borrowing one. Co-authored-by: Copilot App <[email protected]> * Document that the Arrow manifest readers take decrypted bytes * Rename the Arrow manifest bindings to *_as_arrow_reader Co-authored-by: Copilot App <[email protected]> --------- Co-authored-by: Kevin Liu <[email protected]> Co-authored-by: Copilot App <[email protected]>
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.
An Avro record with no fields is legal, and encodes to zero bytes. The reader accepts such a schema and decodes its (empty) bytes fine, but fails at flush:
Decoder::Recordflushes throughStructArray::try_new, which infers its length from the first child array, but a zero-field record has no child array.RecordDecoder::flush(the top level) already handles this: it passes its ownrow_countthroughRecordBatchOptions::with_row_count. This change gives the nested case the same treatment.Decoder::Recordnow carries a row count, incremented wherever a row is appended and reset atflush.Which issue does this PR close?
Are these changes tested?
See included tests.
Are there any user-facing changes?
No