pub struct ReaderBuilder { /* private fields */ }
Expand description

CSV file reader builder

Implementations§

Create a new builder for configuring CSV parsing options.

To convert a builder into a reader, call ReaderBuilder::build

Example
use arrow_csv::{Reader, ReaderBuilder};
use std::fs::File;

fn example() -> Reader<File> {
    let file = File::open("test/data/uk_cities_with_headers.csv").unwrap();

    // create a builder, inferring the schema with the first 100 records
    let builder = ReaderBuilder::new().infer_schema(Some(100));

    let reader = builder.build(file).unwrap();

    reader
}

Set the CSV file’s schema

Set whether the CSV file has headers

Set the datetime regex used to parse the string to Date64Type this regex is used while infering schema

Set the datetime fromat used to parse the string to Date64Type this fromat is used while when the schema wants to parse Date64Type.

For format refer to chrono docs

Set the CSV file’s column delimiter as a byte character

Set the CSV reader to infer the schema of the file

Set the batch size (number of records to load at one time)

Set the bounds over which to scan the reader. start and end are line numbers.

Set the reader’s column projection

Create a new Reader from a non-buffered reader

If R: BufRead consider using Self::build_buffered to avoid unnecessary additional buffering, as internally this method wraps reader in std::io::BufReader

Create a new BufReader from a buffered reader

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.