Skip to main content

read_to_batch

Function read_to_batch 

Source
pub fn read_to_batch<P: AsRef<Path>>(
    path: P,
) -> Result<RecordBatch, ReadStatError>
Expand description

Reads every row of a .sas7bdat file into a single Arrow [RecordBatch].

Best for files that fit comfortably in memory. For large files, use ReadStatReader::visit to process bounded chunks.

let batch = readstat::read_to_batch("data.sas7bdat")?;
println!("{} rows x {} columns", batch.num_rows(), batch.num_columns());

ยงErrors

Returns ReadStatError if the path is invalid, FFI parsing fails, or the row count cannot be represented (i.e. is negative).