viirya commented on code in PR #3402:
URL: https://github.com/apache/arrow-rs/pull/3402#discussion_r1061807074


##########
arrow-flight/src/client.rs:
##########
@@ -256,13 +258,273 @@ impl FlightClient {
         Ok(response)
     }
 
+    /// Make a `DoPut` call to the server with the provided
+    /// [`Stream`](futures::Stream) of [`FlightData`] and returning a
+    /// stream of [`PutResult`].
+    ///
+    /// # Example:
+    /// ```no_run
+    /// # async fn run() {
+    /// # use futures::{TryStreamExt, StreamExt};
+    /// # use std::sync::Arc;
+    /// # use arrow_array::UInt64Array;
+    /// # use arrow_array::RecordBatch;
+    /// # use arrow_flight::{FlightClient, FlightDescriptor, PutResult};
+    /// # use arrow_flight::encode::FlightDataEncoderBuilder;
+    /// # let batch = RecordBatch::try_from_iter(vec![
+    /// #  ("col2", Arc::new(UInt64Array::from_iter([10, 23, 33])) as _)
+    /// # ]).unwrap();
+    /// # let channel: tonic::transport::Channel = unimplemented!();
+    /// let mut client = FlightClient::new(channel);
+    ///
+    /// // encode the batch as a stream of `FlightData`
+    /// let flight_data_stream = FlightDataEncoderBuilder::new()
+    ///   .build(futures::stream::iter(vec![Ok(batch)]))
+    ///   // data encoder return Results, but do_put requires FlightData

Review Comment:
   Hmm, I guess that the input is not fallible? I'm not sure what the semantics 
is on `put` if it encounters non-complete data.



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to