-
Notifications
You must be signed in to change notification settings - Fork 833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Make AsyncArrowWriter accepts AsyncFileWriter #5753
Conversation
a680933
to
4d0fe42
Compare
/// | ||
/// The underlying writer CAN decide to buffer the data or write it immediately. | ||
/// This design allows the writer implementer to control the buffering and I/O scheduling. | ||
fn write(&mut self, bs: Bytes) -> BoxFuture<'_, Result<()>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should document atomicity requirements for this method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find current ArrowWriter's design is also not safe to retry. I will update the behavior notes of write
to make it more clear and just take the Vec<u8>
here to make this PR more simple.
4d0fe42
to
723515d
Compare
Hi @tustvold, PTAL. Thanks! |
Signed-off-by: Xuanwo <github@xuanwo.io>
723515d
to
2076737
Compare
Thank you |
Which issue does this PR close?
Closes #5738
Rationale for this change
This makes
AsyncArrowWriter
acceptsAsyncFileWriter
so users can save an extra copy if they have a writer that can acceptBytes
directly.What changes are included in this PR?
A bit change from the proposal but mainly the same.
Are there any user-facing changes?
AsyncArrowWriter
now acceptsAsyncFileWriter
instead ofAsyncWrite
. ButAsyncFileWriter
has been implemented for allAsyncWrite
, so existing code should be working as before. For example, all testing code is not touched 💌Maybe we can catch up the arrow 52's train? #5688