Weijun-H commented on code in PR #4101:
URL: https://github.com/apache/arrow-rs/pull/4101#discussion_r1175746385
##########
arrow-flight/tests/encode_decode.rs:
##########
@@ -136,6 +138,31 @@ async fn test_zero_batches_schema_specified() {
assert_eq!(decoder.schema(), Some(&schema));
}
+#[tokio::test]
+async fn test_with_flight_descriptor() {
+ let stream = futures::stream::iter(vec![Ok(make_dictionary_batch(5))]);
+ let schema = Arc::new(Schema::new(vec![Field::new("a", DataType::Utf8,
true)]));
+
+ let descriptor = Some(FlightDescriptor {
+ r#type: DescriptorType::Path.into(),
+ path: vec!["table_name".to_string()],
+ cmd: Bytes::default(),
+ });
+
+ let encoder = FlightDataEncoderBuilder::default()
+ .with_schema(schema.clone())
+ .with_flight_descriptor(descriptor.clone());
+
+ let mut encoder = encoder.build(stream);
+
+ // First batch should be the schema
+ encoder.next().await.unwrap().unwrap();
Review Comment:
Yes, you are right. I completely misunderstood it.
--
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]