djanderson commented on code in PR #6201:
URL: https://github.com/apache/arrow-rs/pull/6201#discussion_r1718550531
##########
arrow-flight/src/sql/client.rs:
##########
@@ -227,6 +227,38 @@ impl FlightSqlServiceClient<Channel> {
Ok(result.record_count)
}
+ /// Execute a bulk ingest on the server and return the number of records
added
+ pub async fn execute_ingest<S>(
+ &mut self,
+ command: CommandStatementIngest,
+ stream: S,
+ ) -> Result<i64, ArrowError>
+ where
+ S: Stream<Item = crate::error::Result<RecordBatch>> + Send + 'static,
+ {
+ let descriptor =
FlightDescriptor::new_cmd(command.as_any().encode_to_vec());
+ let flight_data_encoder = FlightDataEncoderBuilder::new()
+ .with_flight_descriptor(Some(descriptor))
+ .build(stream);
+ // Safe unwrap, explicitly wrapped on line above.
+ let flight_data = flight_data_encoder.map(|fd| fd.unwrap());
Review Comment:
This comment is no longer true, but is it still reasonable to unwrap or
should we raise the error, or fuse the input stream, or...?
--
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]