alexwilcoxson-rel opened a new issue, #3855:
URL: https://github.com/apache/arrow-rs/issues/3855

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   When using FlightDataEncoder to send arrow batches to a flight do_put 
endpoint, FlightDescriptor cannot easily be set on first message. 
https://arrow.apache.org/docs/format/Flight.html#uploading-data
   
   **Describe the solution you'd like**
   On FlightDataEncoderBuilder a `with_flight_descriptor` method would be nice. 
The FlightDescriptor would then be set on the first FlightData retrieved from 
the encoder.
   
   **Describe alternatives you've considered**
   Here is a workaround, I may be missing something simpler
   ```rust
   let mut encoder = FlightDataEncoderBuilder::new()
       .with_schema(schema.clone())
       .build(stream);
   
   let mut first_flight_data = encoder
       .next()
       .await
       .expect("no flight data")
       .expect("flight data was error");
   first_flight_data.flight_descriptor = Some(FlightDescriptor {
       r#type: DescriptorType::Path.into(),
       path: vec!["table_name".to_string()],
       cmd: Bytes::default(),
   });
   let put_stream = stream::once(async { Ok(first_flight_data) 
}).chain(encoder);
   ```


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