()
| 2796 | |
| 2797 | #[test] |
| 2798 | fn test_parse_string_view_single_column() { |
| 2799 | let csv = ["foo", "something_cannot_be_inlined", "foobar"].join("\n"); |
| 2800 | let schema = Arc::new(Schema::new(vec![Field::new( |
| 2801 | "c1", |
| 2802 | DataType::Utf8View, |
| 2803 | true, |
| 2804 | )])); |
| 2805 | |
| 2806 | let mut decoder = ReaderBuilder::new(schema).build_decoder(); |
| 2807 | |
| 2808 | let decoded = decoder.decode(csv.as_bytes()).unwrap(); |
| 2809 | assert_eq!(decoded, csv.len()); |
| 2810 | decoder.decode(&[]).unwrap(); |
| 2811 | |
| 2812 | let batch = decoder.flush().unwrap().unwrap(); |
| 2813 | assert_eq!(batch.num_columns(), 1); |
| 2814 | assert_eq!(batch.num_rows(), 3); |
| 2815 | let col = batch.column(0).as_string_view(); |
| 2816 | assert_eq!(col.data_type(), &DataType::Utf8View); |
| 2817 | assert_eq!(col.value(0), "foo"); |
| 2818 | assert_eq!(col.value(1), "something_cannot_be_inlined"); |
| 2819 | assert_eq!(col.value(2), "foobar"); |
| 2820 | } |
| 2821 | |
| 2822 | #[test] |
| 2823 | fn test_parse_string_view_multi_column() { |
nothing calls this directly
no test coverage detected