polars_parquet::arrow::read::schema

Function infer_schema

Source
pub fn infer_schema(file_metadata: &FileMetadata) -> PolarsResult<ArrowSchema>
Expand description

Infers a ArrowSchema from parquet’s FileMetadata.

This first looks for the metadata key "ARROW:schema"; if it does not exist, it converts the Parquet types declared in the file’s Parquet schema to Arrow’s equivalent.

§Error

This function errors iff the key "ARROW:schema" exists but is not correctly encoded, indicating that the file’s arrow metadata was incorrectly written.