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

Function test_dictionary

arrow/tests/array_transform.rs:312–326  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

310
311#[test]
312fn test_dictionary() {
313 // (a, b, c), (0, 1, 0, 2) => (a, b, a, c)
314 let array = create_dictionary_array(&["a", "b", "c"], &[Some("a"), Some("b"), None, Some("c")]);
315 let arrays = vec![&array];
316
317 let mut mutable = MutableArrayData::new(arrays, false, 0);
318
319 mutable.extend(0, 1, 3);
320
321 let result = mutable.freeze();
322 let result = DictionaryArray::from(result);
323
324 let expected = Int16Array::from(vec![Some(1), None]);
325 assert_eq!(result.keys(), &expected);
326}
327
328#[test]
329fn test_struct() {

Callers

nothing calls this directly

Calls 3

freezeMethod · 0.80
create_dictionary_arrayFunction · 0.70
extendMethod · 0.45

Tested by

no test coverage detected