tustvold commented on code in PR #5753:
URL: https://github.com/apache/arrow-rs/pull/5753#discussion_r1597482302
##########
parquet/src/arrow/async_writer/mod.rs:
##########
@@ -188,12 +234,7 @@ impl<W: AsyncWrite + Unpin + Send> AsyncArrowWriter<W> {
let buffer = self.sync_writer.inner_mut();
self.async_writer
- .write_all(buffer.as_slice())
- .await
- .map_err(|e| ParquetError::External(Box::new(e)))?;
-
- self.async_writer
- .flush()
+ .write(Bytes::copy_from_slice(buffer))
Review Comment:
BytesMut would be the same, freeze is consuming -
https://docs.rs/bytes/latest/bytes/struct.BytesMut.html#method.freeze.
Preserving retries I think could be done by simply stashing a copy of the
produced Bytes on AsyncWriter. Although this would be assuming that the
underlying write API is atomic
--
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]