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

Function test_extend

arrow-array/src/builder/primitive_dictionary_builder.rs:565–575  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

563
564 #[test]
565 fn test_extend() {
566 let mut builder = PrimitiveDictionaryBuilder::<Int32Type, Int32Type>::new();
567 builder.extend([1, 2, 3, 1, 2, 3, 1, 2, 3].into_iter().map(Some));
568 builder.extend([4, 5, 1, 3, 1].into_iter().map(Some));
569 let dict = builder.finish();
570 assert_eq!(
571 dict.keys().values(),
572 &[0, 1, 2, 0, 1, 2, 0, 1, 2, 3, 4, 0, 2, 0]
573 );
574 assert_eq!(dict.values().len(), 5);
575 }
576
577 #[test]
578 #[should_panic(expected = "DictionaryKeyOverflowError")]

Callers

nothing calls this directly

Calls 3

extendMethod · 0.45
into_iterMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected