Xuanwo commented on code in PR #5753:
URL: https://github.com/apache/arrow-rs/pull/5753#discussion_r1599328506


##########
parquet/src/arrow/async_writer/mod.rs:
##########
@@ -59,13 +59,59 @@ use crate::{
 };
 use arrow_array::RecordBatch;
 use arrow_schema::SchemaRef;
+use bytes::Bytes;
+use futures::future::BoxFuture;
+use futures::FutureExt;
 use tokio::io::{AsyncWrite, AsyncWriteExt};
 
-/// Encodes [`RecordBatch`] to parquet, outputting to an [`AsyncWrite`]
+/// The asynchronous interface used by [`AsyncArrowWriter`] to write parquet 
files
+pub trait AsyncFileWriter: Send {
+    /// Write the provided bytes to the underlying writer
+    ///
+    /// 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<()>>;

Review Comment:
   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.



-- 
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]

Reply via email to