You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[python] Enable Parquet page indexes when supported - #9976
Enable Parquet page indexes by default when supported (PyArrow >= 13), preserving older-version compatibility. parquet.write-page-index.enabled=false disables them; explicit true rejects unsupported versions before creating files.
Tests
286 local tests passed. Verified all three states, vector files, PyArrow 6/12 compatibility, and Java Parquet/Rust readback. Lint, license checks, and git diff --check passed.
I think the default behavior should align with the Java writer: write the Parquet Page Index whenever the installed PyArrow version supports it, instead of defaulting to false.
Paimon Java, through parquet-java, already writes ColumnIndex and OffsetIndex by default. Keeping Python disabled by default means that files written to the same table have different metadata depending on the writer implementation.
A plain default_value(True) would break the PyArrow 6/7 versions that PyPaimon still supports, so I suggest capability-aware, three-state semantics:
unset: enable automatically on PyArrow >= 13; omit the argument on older versions;
explicit true: enable it, and fail before creating output when PyArrow < 13;
explicit false: always disable it.
This could be implemented by making the option have no configured default and resolving the default in create_parquet_writer_options based on the installed PyArrow version. The documentation could describe the default as: "enabled when supported by the installed PyArrow version (PyArrow >= 13); otherwise disabled."
The tests should then expect setting=None to produce Page Indexes on PyArrow >= 13, while a mocked PyArrow 12 should still write successfully without passing write_page_index.
The option name itself looks reasonable to me: "Page Index" is the Parquet specification term, and write-page-index is consistent with PyArrow write_page_index and Impala PARQUET_WRITE_PAGE_INDEX.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Enable Parquet page indexes by default when supported (PyArrow >= 13), preserving older-version compatibility.
parquet.write-page-index.enabled=falsedisables them; explicittruerejects unsupported versions before creating files.Tests
286 local tests passed. Verified all three states, vector files, PyArrow 6/12 compatibility, and Java Parquet/Rust readback. Lint, license checks, and
git diff --checkpassed.