()
| 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 | } |
nothing calls this directly
no test coverage detected