Function polars_io::ndjson_core::ndjson::arrow_ndjson::read::infer
source · pub fn infer<R>(
reader: &mut R,
number_of_rows: Option<usize>
) -> Result<DataType, Error>where
R: BufRead,
Available on crate features
json
and io_json
only.Expand description
Infers the DataType
from an NDJSON file, optionally only using number_of_rows
rows.
Implementation
This implementation reads the file line by line and infers the type of each line.
It performs both O(N)
IO and CPU-bounded operations where N
is the number of rows.