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

Function test_nulls

parquet/src/arrow/array_reader/byte_array_dictionary.rs:643–683  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

641
642 #[test]
643 fn test_nulls() {
644 let data_type = utf8_dictionary();
645 let (pages, encoded_dictionary) = byte_array_all_encodings(Vec::<&str>::new());
646
647 let column_desc = utf8_column();
648 let mut decoder = DictionaryDecoder::new(&column_desc);
649
650 decoder
651 .set_dict(encoded_dictionary, 4, Encoding::PLAIN_DICTIONARY, false)
652 .unwrap();
653
654 for (encoding, page) in pages.clone() {
655 let mut output = DictionaryBuffer::<i32, i32>::with_capacity(0);
656 decoder.set_data(encoding, page, 8, None).unwrap();
657 assert_eq!(decoder.read(&mut output, 1024).unwrap(), 0);
658
659 output.pad_nulls(0, 0, 8, &[0]);
660 let array = output
661 .into_array(Some(Buffer::from(&[0])), &data_type)
662 .unwrap();
663
664 assert_eq!(array.len(), 8);
665 assert_eq!(array.null_count(), 8);
666 assert_eq!(array.logical_null_count(), 8);
667 }
668
669 for (encoding, page) in pages {
670 let mut output = DictionaryBuffer::<i32, i32>::with_capacity(0);
671 decoder.set_data(encoding, page, 8, None).unwrap();
672 assert_eq!(decoder.skip_values(1024).unwrap(), 0);
673
674 output.pad_nulls(0, 0, 8, &[0]);
675 let array = output
676 .into_array(Some(Buffer::from(&[0])), &data_type)
677 .unwrap();
678
679 assert_eq!(array.len(), 8);
680 assert_eq!(array.null_count(), 8);
681 assert_eq!(array.logical_null_count(), 8);
682 }
683 }
684}

Callers

nothing calls this directly

Calls 8

utf8_dictionaryFunction · 0.85
byte_array_all_encodingsFunction · 0.85
utf8_columnFunction · 0.85
set_dictMethod · 0.45
cloneMethod · 0.45
set_dataMethod · 0.45
pad_nullsMethod · 0.45
into_arrayMethod · 0.45

Tested by

no test coverage detected