scanCsv
fn
LazyFrame scanCsv(string path, Schema schema,
CsvReadPolicy policy = CsvReadPolicy.init,
CsvScanMode mode = CsvScanMode.AUTO) @trustedOpens a CSV file as a lazy scan source: the returned deferred frame pulls one batch per policy.chunkRows rows when collected or streamed, without loading the file first. The schema is explicit (inference arrives with its own contract); parse errors surface in file order at the first failing batch, exactly like the eager serial reader.
Parameters
path | the CSV file path |
schema | the expected columns (by name when policy.hasHeader, by position otherwise) |
policy | the reading policy |
mode | the input mode (AUTO: mmap for regular files, buffered otherwise) |
Returns
the deferred frame over the scan source.
Throws
DataFrameException when the file cannot be opened, or
MMAP is requested for a source that cannot be mapped.
Ditto, from an already-open handle (a pipe, stdin, a socket stream - the buffered mode by construction; the source owns the handle until close()).