sqd opened a new pull request, #10771:
URL: https://github.com/apache/arrow-rs/pull/10771
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 #10770.
# Are these changes tested?
See included tests.
# Are there any user-facing changes?
No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]