stuartcarnie opened a new issue, #3779: URL: https://github.com/apache/arrow-rs/issues/3779
**Describe the bug** When preparing schema for encoding into a Flight response, the schema-level metadata from the source schema is dropped: https://github.com/apache/arrow-rs/blob/e7eb304dac442a943c434f8ea248de909f82aa88/arrow-flight/src/encode.rs#L326 **To Reproduce** ```patch Index: arrow-flight/src/encode.rs IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/arrow-flight/src/encode.rs b/arrow-flight/src/encode.rs --- a/arrow-flight/src/encode.rs (revision e7eb304dac442a943c434f8ea248de909f82aa88) +++ b/arrow-flight/src/encode.rs (date 1677611826249) @@ -453,6 +453,7 @@ #[cfg(test)] mod tests { + use std::collections::HashMap; use arrow::{ array::{UInt32Array, UInt8Array}, compute::concat_batches, @@ -502,6 +503,16 @@ ); } + #[test] + fn test_schema_metadata_encoded() { + let schema = Schema::new(vec![ + Field::new("data", DataType::Int32, false), + ]).with_metadata(HashMap::from([("some_key".to_owned(), "some_value".to_owned())])); + + let got = prepare_schema_for_flight(&schema); + assert!(got.metadata().contains_key("some_key")); + } + #[test] fn test_encode_no_column_batch() { let batch = RecordBatch::try_new_with_options( ``` **Expected behavior** Schema-level metadata should be included permitting test to pass. **Additional context** <!-- Add any other context about the problem here. --> -- 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]
