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

Function test_timestamp

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

Source from the content-addressed store, hash-verified

1002
1003 #[test]
1004 fn test_timestamp() -> Result<()> {
1005 // create an array natively
1006 let array = TimestampMillisecondArray::from(vec![None, Some(1), Some(2)]);
1007
1008 // export it
1009 let (array, schema) = to_ffi(&array.to_data())?;
1010
1011 // (simulate consumer) import it
1012 let data = unsafe { from_ffi(array, &schema) }?;
1013 let array = make_array(data);
1014 let array = array
1015 .as_any()
1016 .downcast_ref::<TimestampMillisecondArray>()
1017 .unwrap();
1018
1019 // verify
1020 assert_eq!(
1021 array,
1022 &TimestampMillisecondArray::from(vec![None, Some(1), Some(2)])
1023 );
1024
1025 // (drop/release)
1026 Ok(())
1027 }
1028
1029 #[test]
1030 fn test_fixed_size_binary_array() -> Result<()> {

Callers

nothing calls this directly

Calls 5

to_ffiFunction · 0.85
from_ffiFunction · 0.85
make_arrayFunction · 0.50
to_dataMethod · 0.45
as_anyMethod · 0.45

Tested by

no test coverage detected