pub type Reader<R> = BufReader<StdBufReader<R>>;
Expand description
CSV file reader using std::io::BufReader
Implementations§
source§impl<R: Read> Reader<R>
impl<R: Read> Reader<R>
sourcepub fn new(
reader: R,
schema: SchemaRef,
has_header: bool,
delimiter: Option<u8>,
batch_size: usize,
bounds: Option<(usize, usize)>,
projection: Option<Vec<usize>>,
datetime_format: Option<String>
) -> Self
pub fn new(
reader: R,
schema: SchemaRef,
has_header: bool,
delimiter: Option<u8>,
batch_size: usize,
bounds: Option<(usize, usize)>,
projection: Option<Vec<usize>>,
datetime_format: Option<String>
) -> Self
Create a new CsvReader from any value that implements the Read
trait.
If reading a File
or an input that supports std::io::Read
and std::io::Seek
;
you can customise the Reader, such as to enable schema inference, use
ReaderBuilder
.
sourcepub fn schema(&self) -> SchemaRef
pub fn schema(&self) -> SchemaRef
Returns the schema of the reader, useful for getting the schema without reading record batches
sourcepub fn from_reader(
reader: R,
schema: SchemaRef,
has_header: bool,
delimiter: Option<u8>,
batch_size: usize,
bounds: Option<(usize, usize)>,
projection: Option<Vec<usize>>,
datetime_format: Option<String>
) -> Self
👎Deprecated: Use Reader::new or ReaderBuilder
pub fn from_reader(
reader: R,
schema: SchemaRef,
has_header: bool,
delimiter: Option<u8>,
batch_size: usize,
bounds: Option<(usize, usize)>,
projection: Option<Vec<usize>>,
datetime_format: Option<String>
) -> Self
Create a new CsvReader from a Reader
This constructor allows you more flexibility in what records are processed by the csv reader.