MCPcopy Create free account
hub / github.com/apache/arrow-rs / test_stream_round_trip

Function test_stream_round_trip

arrow-array/src/ffi_stream.rs:496–514  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

494
495 #[test]
496 fn test_stream_round_trip() {
497 let array = Int32Array::from(vec![Some(2), None, Some(1), None]);
498 let array: Arc<dyn Array> = Arc::new(array);
499 let metadata = HashMap::from([("foo".to_owned(), "bar".to_owned())]);
500
501 let schema = Arc::new(Schema::new_with_metadata(
502 vec![
503 Field::new("a", array.data_type().clone(), true).with_metadata(metadata.clone()),
504 Field::new("b", array.data_type().clone(), true).with_metadata(metadata.clone()),
505 Field::new("c", array.data_type().clone(), true).with_metadata(metadata.clone()),
506 ],
507 metadata,
508 ));
509 let batch = RecordBatch::try_new(schema.clone(), vec![array.clone(), array.clone(), array])
510 .unwrap();
511
512 _test_round_trip_export(batch.clone(), schema.clone()).unwrap();
513 _test_round_trip_import(batch, schema).unwrap();
514 }
515
516 #[test]
517 fn test_stream_round_trip_no_columns() {

Callers

nothing calls this directly

Calls 4

try_newFunction · 0.85
_test_round_trip_exportFunction · 0.85
_test_round_trip_importFunction · 0.85
cloneMethod · 0.45

Tested by

no test coverage detected