pub fn read_until_start_and_infer_schema(
options: &CsvReadOptions,
projected_schema: Option<SchemaRef>,
inspect_first_content_row_fn: Option<InspectContentFn<'_>>,
reader: &mut CompressedReader,
) -> PolarsResult<(Schema, MemSlice)>Available on crate features
csv or json only.Expand description
Reads bytes from reader until the CSV starting point is reached depending on the options.
Returns the inferred schema and leftover bytes not yet consumed, which may be empty. The
leftover bytes + reader.read_next_slice is guaranteed to start at first real content row.
inspect_first_content_row_fn allows looking at the first content row, this is where parsing
will start. Beware even if the function is provided it’s not guaranteed that the returned
value will be Some, since it the CSV may be incomplete.
The reading is done in an iterative streaming fashion
This function isn’t perf critical but would increase binary-size so don’t inline it.