This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
Fixed error in reading a non-finished IPC stream. #302
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.
When the stream reader gets called
.next()
and the stream has not finished, we should not error nor returnNone
(end of stream), and instead should offer the stateWaiting
, so that the user can decide what to do if no new batches have been observed, but no finished state has also been found.This PR changes the return state of the stream reader returns
Option<Result<State>>
whereState
:None
describes the end of the streamSome(Err)
describes an errorSome(Ok(State::Waiting))
describes that the stream has not finished, but that no new data is available to readSome(Ok(State::Some(_))
describes a new batchThanks a lot to @HagaiHargil for clarifying the limitations of the stream reader.
Backwards incompatible changes:
StreamReader
no longer implementsRecordBatchReader
Iterator
implementation ofStreamReader
no longer returnsOption<Result<RecordBatch>>
and instead returnsOption<Result<State>>
. UseState::unwrap
if you are certain that the stream contains a batch (and is not waiting).Closes #301