| 1875 | } |
| 1876 | |
| 1877 | fn invalid_csv_helper(file_name: &str) -> String { |
| 1878 | let file = File::open(file_name).unwrap(); |
| 1879 | let schema = Schema::new(vec![ |
| 1880 | Field::new("c_int", DataType::UInt64, false), |
| 1881 | Field::new("c_float", DataType::Float32, false), |
| 1882 | Field::new("c_string", DataType::Utf8, false), |
| 1883 | Field::new("c_bool", DataType::Boolean, false), |
| 1884 | ]); |
| 1885 | |
| 1886 | let builder = ReaderBuilder::new(Arc::new(schema)) |
| 1887 | .with_header(true) |
| 1888 | .with_delimiter(b'|') |
| 1889 | .with_batch_size(512) |
| 1890 | .with_projection(vec![0, 1, 2, 3]); |
| 1891 | |
| 1892 | let mut csv = builder.build(file).unwrap(); |
| 1893 | |
| 1894 | csv.next().unwrap().unwrap_err().to_string() |
| 1895 | } |
| 1896 | |
| 1897 | #[test] |
| 1898 | fn test_parse_invalid_csv_float() { |