Skip to content

Commit 13c646a

Browse files
committed
refactor: use Decoder::flush_block in async reader
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.
1 parent 471f6c3 commit 13c646a

File tree

1 file changed

+2
-2
lines changed
  • arrow-avro/src/reader/async_reader

1 file changed

+2
-2
lines changed

arrow-avro/src/reader/async_reader/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ impl<R> AsyncAvroFileReader<R> {
228228
/// Drain any remaining buffered records from the decoder.
229229
#[inline]
230230
fn poll_flush(&mut self) -> Poll<Option<Result<RecordBatch, AvroError>>> {
231-
match self.decoder.flush() {
231+
match self.decoder.flush_block() {
232232
Ok(Some(batch)) => {
233233
self.reader_state = ReaderState::Flushing;
234234
Poll::Ready(Some(Ok(batch)))
@@ -512,7 +512,7 @@ impl<R: AsyncFileReader + Unpin + 'static> AsyncAvroFileReader<R> {
512512
// We have a full batch ready, emit it
513513
// (This is not mutually exclusive with the block being finished, so the state change is valid)
514514
if self.decoder.batch_is_full() {
515-
return match self.decoder.flush() {
515+
return match self.decoder.flush_block() {
516516
Ok(Some(batch)) => Poll::Ready(Some(Ok(batch))),
517517
Ok(None) => self.finish_with_error(AvroError::General(
518518
"Decoder reported a full batch, but flush returned None".into(),

0 commit comments

Comments
 (0)