lance_datafusion::utils

Function peek_reader_schema

Source
pub async fn peek_reader_schema(
    batches: Box<dyn RecordBatchReader + Send>,
) -> Result<(Box<dyn RecordBatchReader + Send>, Schema)>
Expand description

Infer the Lance schema from the first batch.

This will peek the first batch to get the dictionaries for dictionary columns.

NOTE: this does not validate the schema. For example, for appends the schema should be checked to make sure it matches the existing dataset schema before writing.