Skip to content

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

Merged
pitrou merged 1 commit into
apache:mainfrom
Diveyam-Mishra:gh-51264
Sep 14, 2026
Merged

pitrou merged 1 commit into
apache:mainfrom
Diveyam-Mishra:gh-51264

Conversation

@Diveyam-Mishra

@Diveyam-Mishra Diveyam-Mishra commented Sep 9, 2026

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

Comment thread cpp/src/arrow/dataset/file_parquet.cc
@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

@Diveyam-Mishra

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

@pitrou

pitrou commented Sep 14, 2026

Copy link
Copy Markdown
Member

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

Unfortunately a number of our CI jobs are broken currently.

@pitrou pitrou left a comment

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.

LGTM, thank you @Diveyam-Mishra

@pitrou

pitrou commented Sep 14, 2026

Copy link
Copy Markdown
Member

CI failures are unrelated, I'll merge.

@pitrou
pitrou merged commit 896e913 into apache:main Sep 14, 2026
58 of 62 checks passed
@pitrou pitrou removed the awaiting committer review Awaiting committer review label Sep 14, 2026
@Diveyam-Mishra

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

Unfortunately a number of our CI jobs are broken currently.

Let me look into this after this gets merged

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants