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

Function test_round_trip

arrow-array/src/ffi.rs:601–613  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

599
600 #[test]
601 fn test_round_trip() {
602 // create an array natively
603 let array = Int32Array::from(vec![1, 2, 3]);
604
605 // export it
606 let (array, schema) = to_ffi(&array.into_data()).unwrap();
607
608 // (simulate consumer) import it
609 let array = Int32Array::from(unsafe { from_ffi(array, &schema) }.unwrap());
610
611 // verify
612 assert_eq!(array, Int32Array::from(vec![1, 2, 3]));
613 }
614
615 #[test]
616 fn test_import() {

Callers 13

test_u32Function · 0.70
test_u64Function · 0.70
test_i64Function · 0.70
test_structFunction · 0.70
test_dictionaryFunction · 0.70
test_fixed_size_binaryFunction · 0.70
test_fixed_size_listFunction · 0.70
test_list_viewFunction · 0.70

Calls 4

to_ffiFunction · 0.85
from_ffiFunction · 0.85
into_dataMethod · 0.45
data_typeMethod · 0.45

Tested by

no test coverage detected