timsaucer opened a new issue, #19292:
URL: https://github.com/apache/datafusion/issues/19292

   ### Describe the bug
   
   If a `RecordBatch` has metadata on the schema level (not field level) it is 
lost during FFI conversion.
   
   ### To Reproduce
   
   ```
       #[test]
       fn round_trip_record_batch_with_metadata() -> Result<()> {
           let rb = record_batch!(
               ("a", Int32, vec![1, 2, 3]),
               ("b", Float64, vec![Some(4.0), None, Some(5.0)])
           )?;
   
           let schema = 
rb.schema().as_ref().clone().with_metadata([("some_key".to_owned(), 
"some_value".to_owned())].into()).into();
   
           let rb = rb.with_schema(schema)?;
   
           let ffi_rb = df_result!(record_batch_to_wrapped_array(rb.clone()))?;
   
           let round_trip_rb = wrapped_array_to_record_batch(ffi_rb)?;
   
           assert_eq!(rb, round_trip_rb);
           Ok(())
       }
   ```
   
   ### Expected behavior
   
   Round trip of a record batch should return identical.
   
   ### Additional context
   
   _No response_


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to