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

Function test_null_struct

arrow-array/src/array/mod.rs:1137–1152  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1135
1136 #[test]
1137 fn test_null_struct() {
1138 // It is possible to create a null struct containing a non-nullable child
1139 // see https://github.com/apache/arrow-rs/pull/3244 for details
1140 let struct_type = DataType::Struct(vec![Field::new("data", DataType::Int64, false)].into());
1141 let array = new_null_array(&struct_type, 9);
1142
1143 let a = array.as_any().downcast_ref::<StructArray>().unwrap();
1144 assert_eq!(a.len(), 9);
1145 assert_eq!(a.column(0).len(), 9);
1146 for i in 0..9 {
1147 assert!(a.is_null(i));
1148 }
1149
1150 // Make sure we can slice the resulting array.
1151 a.slice(0, 5);
1152 }
1153
1154 #[test]
1155 fn test_null_variable_sized() {

Callers

nothing calls this directly

Calls 3

new_null_arrayFunction · 0.85
as_anyMethod · 0.45
sliceMethod · 0.45

Tested by

no test coverage detected