Skip to content

Navigation Menu

Sign in
Sign up

GH-51264: [C++][Parquet] Make MemoryPool settable on ReaderProperties - #51269

Open
Diveyam-Mishra wants to merge 1 commit into
apache:main from
Diveyam-Mishra:gh-51264
Open

GH-51264: [C++][Parquet] Make MemoryPool settable on ReaderProperties #51269
Diveyam-Mishra wants to merge 1 commit into
apache:main from
Diveyam-Mishra:gh-51264

Conversation

@Diveyam-Mishra

@Diveyam-Mishra Diveyam-Mishra commented Sep 9, 2026
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Contributor

Rationale for this change
In arrow::dataset::MakeReaderProperties, all parquet::ReaderProperties options had to be copied field-by-field from parquet_scan_options->reader_properties because ReaderProperties did not support mutating or setting MemoryPool* after construction.

What changes are included in this PR?
Added set_memory_pool to parquet::ReaderProperties in cpp/src/parquet/properties.h.
Added unit test TestReaderProperties.SetMemoryPool in cpp/src/parquet/properties_test.cc.

Are these changes tested?
Yes

Are there any user-facing changes?
No

Copilot AI lite review requested due to automatic review settings September 9, 2026 22:38
@Diveyam-Mishra Diveyam-Mishra changed the title (削除) GH-51264: [C++][Parquet] Make MemoryPool settable on ReaderProperties and simplify dataset MakeReaderProperties (削除ここまで) (追記) GH-51264: [C++][Parquet] Make MemoryPool settable on ReaderProperties (追記ここまで) Sep 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new unit test can be ineffective on builds where default_memory_pool() equals system_memory_pool(), so it may not actually validate the new setter behavior.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds the ability to mutate parquet::ReaderProperties’ memory pool after construction, enabling arrow::dataset::MakeReaderProperties to copy reader properties wholesale (instead of field-by-field) while still overriding the pool for dataset reads.

Changes:

  • Add ReaderProperties::set_memory_pool(MemoryPool*) to allow post-construction pool updates.
  • Simplify dataset Parquet MakeReaderProperties by copying ReaderProperties and overriding only the pool (and encryption props when configured).
  • Expose the new API to PyArrow Cython declarations and add a unit test for the new setter.
File summaries
File Description
python/pyarrow/includes/libparquet.pxd Exposes memory_pool() and set_memory_pool() for parquet::ReaderProperties to PyArrow.
cpp/src/parquet/properties.h Adds ReaderProperties::set_memory_pool() mutator.
cpp/src/parquet/properties_test.cc Adds a unit test covering set_memory_pool() and copy behavior.
cpp/src/arrow/dataset/file_parquet.cc Simplifies MakeReaderProperties by copying properties and then setting the pool (and encryption props when applicable).
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cpp/src/parquet/properties_test.cc Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Small, well-scoped API addition with corresponding unit test and a straightforward Dataset integration simplification.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

auto file_decryption_prop =
parquet_scan_options->reader_properties->file_decryption_properties();
parquet::ReaderProperties properties = *parquet_scan_options->reader_properties;
properties.set_memory_pool(pool);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to unset read_dense_for_nullable as it wasn't set before?
What do you think @wgtmac ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense if we want to strictly keep the previous behavior. That said, I don't expect users to set read_dense_for_nullable to true when using the dataset reader.

@Diveyam-Mishra Diveyam-Mishra Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed the change so it remains false

@github-actions github-actions Bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Sep 10, 2026
...erties and simplify dataset MakeReaderProperties
Rationale for this change
In arrow::dataset::MakeReaderProperties, all parquet::ReaderProperties options had to be copied field-by-field from parquet_scan_options->reader_properties because ReaderProperties did not support mutating or setting MemoryPool* after construction.
What changes are included in this PR?
Add set_memory_pool to parquet::ReaderProperties in cpp/src/parquet/properties.h.
Add unit test TestReaderProperties.SetMemoryPool in cpp/src/parquet/properties_test.cc.
Are these changes tested?
Yes
Are there any user-facing changes?
No

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review comments were identified, and all assessments indicate approval readiness.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copy link
Copy Markdown
Contributor Author

Also i see anytime someone creates a PR with C++ component 2-3 CI tests fails is that normal or a bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort, defaults to Lite
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@AlenkaF AlenkaF Awaiting requested review from AlenkaF AlenkaF is a code owner
@raulcd raulcd Awaiting requested review from raulcd raulcd is a code owner
@rok rok Awaiting requested review from rok rok is a code owner
@wgtmac wgtmac Awaiting requested review from wgtmac wgtmac is a code owner
@pitrou pitrou Awaiting requested review from pitrou pitrou is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /