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

Function test_dictionary_iter_with_null

arrow-array/src/array/dictionary_array.rs:1316–1334  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1314
1315 #[test]
1316 fn test_dictionary_iter_with_null() {
1317 let test = vec![Some("a"), None, Some("b"), None, None, Some("a")];
1318 let array: DictionaryArray<Int32Type> = test.into_iter().collect();
1319
1320 let mut iter = array
1321 .values()
1322 .as_any()
1323 .downcast_ref::<StringArray>()
1324 .unwrap()
1325 .take_iter(array.keys_iter());
1326
1327 assert_eq!("a", iter.next().unwrap().unwrap());
1328 assert!(iter.next().unwrap().is_none());
1329 assert_eq!("b", iter.next().unwrap().unwrap());
1330 assert!(iter.next().unwrap().is_none());
1331 assert!(iter.next().unwrap().is_none());
1332 assert_eq!("a", iter.next().unwrap().unwrap());
1333 assert!(iter.next().is_none());
1334 }
1335
1336 #[test]
1337 fn test_dictionary_key() {

Callers

nothing calls this directly

Calls 6

collectMethod · 0.80
keys_iterMethod · 0.80
into_iterMethod · 0.45
take_iterMethod · 0.45
as_anyMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected