Module arrow_csv::reader

source ·
Expand description

CSV Reader

This CSV reader allows CSV files to be read into the Arrow memory model. Records are loaded in batches and are then converted from row-based data to columnar data.

Example:


let schema = Schema::new(vec![
    Field::new("city", DataType::Utf8, false),
    Field::new("lat", DataType::Float64, false),
    Field::new("lng", DataType::Float64, false),
]);

let file = File::open("test/data/uk_cities.csv").unwrap();

let mut csv = Reader::new(file, Arc::new(schema), false, None, 1024, None, None, None);
let batch = csv.next().unwrap().unwrap();

Structs

CSV file reader
CSV file reader builder
This is a collection of options for csv reader when the builder pattern cannot be used and the parameters need to be passed around

Functions

Infer the schema of a CSV file by reading through the first n records of the file, with max_read_records controlling the maximum number of records to read.
Infer schema of CSV records provided by struct that implements Read trait.
Infer schema from a list of CSV files by reading through first n records with max_read_records controlling the maximum number of records to read.