Skip to main content
OSS preview A table-valued function (TVF) that returns the internal metadata of Parquet files stored in Amazon S3 without reading their data. The function can use either a location object (recommended) or direct credentials to access the files. For each file it reports the file’s row groups and, within each row group, every column chunk: its encoding, compression, byte sizes, value counts, and column statistics. Optionally it also reports per-page metadata. Use it to understand file layout and decide how to tune a workload: row-group sizing, compression and encoding choices, the column statistics available for pruning, and dictionary usage. It complements READ_PARQUET, which returns the data itself.

Syntax

PARQUET_METADATA accepts the same LOCATION / URL access and authentication parameters as READ_PARQUET, plus the parameter below. It does not accept the data-parsing parameters of READ_PARQUET (SCHEMA, REPLACE_NON_UTF8_BYTES, ESTIMATED_ROWS, PARSE_JSON_AS).

Parameters

For the access and authentication parameters (LOCATION, PATTERN, URL, and AWS_*), see READ_PARQUET parameters.

Return Type

The result is a table whose grain depends on SHOW_PAGES_STATS. With the default FALSE, there is one row per column chunk (one row group’s worth of a single column). With TRUE, there is one row per page, and the per-page columns below are appended. Base columns: Additional columns when SHOW_PAGES_STATS => TRUE:

Examples

The following code example reads the metadata of a Parquet file with SHOW_PAGES_STATS => TRUE, returning one row per page with the full base and page-level columns: