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

Function invalid_csv_helper

arrow-csv/src/reader/mod.rs:1877–1895  ·  view source on GitHub ↗
(file_name: &str)

Source from the content-addressed store, hash-verified

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() {

Callers 3

Calls 6

with_projectionMethod · 0.45
with_batch_sizeMethod · 0.45
with_delimiterMethod · 0.45
with_headerMethod · 0.45
buildMethod · 0.45
nextMethod · 0.45

Tested by 3