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
A push-based interface for decoding CSV data from an arbitrary byte stream
CSV file reader builder

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.

Type Definitions

CSV file reader using std::io::BufReader