Skip to content

Preserve query as Parquet file-level metadata - #2228

Merged
rolandwalker merged 1 commit into
mainfrom
RW/parquet-save-query-as-metadata
Sep 10, 2026
Merged

Preserve query as Parquet file-level metadata#2228
rolandwalker merged 1 commit into
mainfrom
RW/parquet-save-query-as-metadata

Conversation

@rolandwalker

Copy link
Copy Markdown
Contributor

Description

Since the Parquet file format supports file-level metadata, when saving a Parquet with .>, we can preserve the originating query in the file.

The .> operator and target filename are preserved in the query, which might be debatable.

The Polars documentation also warns that the metadata interface is experimental, but our tests should catch any issues on a dependency upgrade.

Example of viewing the file-level metadata in the produced Parquet using the tool parqeye:

parquet_metadata

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

Since the Parquet file format supports file-level metadata, when saving
a Parquet with .>, we can preserve the originating query in the file.

The .> operator and target filename are preserved in the query, which
might be debatable.

The Polars documentation also warns that the metadata interface is
experimental, but our tests should catch any issues on a dependency
upgrade.
@rolandwalker rolandwalker self-assigned this Sep 10, 2026
@rolandwalker
rolandwalker merged commit b069670 into main Sep 10, 2026
11 checks passed
@rolandwalker
rolandwalker deleted the RW/parquet-save-query-as-metadata branch September 10, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant