pyarrow.parquet.write_metadata

pyarrow.parquet.write_metadata(schema, where, metadata_collector=None, **kwargs)[source]

Write metadata-only Parquet file from schema. This can be used with write_to_dataset to generate _common_metadata and _metadata sidecar files.

Parameters
schemapyarrow.Schema
wherestr or pyarrow.NativeFile
metadata_collectorlist

where to collect metadata information.

**kwargsdict,

Additional kwargs for ParquetWriter class. See docstring for ParquetWriter for more information.

Examples

Write a dataset and collect metadata information.

>>> metadata_collector = []
>>> write_to_dataset(
...     table, root_path,
...     metadata_collector=metadata_collector, **writer_kwargs)

Write the _common_metadata parquet file without row groups statistics.

>>> write_metadata(
...     table.schema, root_path / '_common_metadata', **writer_kwargs)

Write the _metadata parquet file with row groups statistics.

>>> write_metadata(
...     table.schema, root_path / '_metadata',
...     metadata_collector=metadata_collector, **writer_kwargs)