alamb commented on code in PR #6201: URL: https://github.com/apache/arrow-rs/pull/6201#discussion_r1718870078
########## 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: I think I fixed that in 22a4a1d7537 -- but it was quite fiddly -- 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