Skip to content

GH-50801: [Python] Expose the record_batch_reader_source Acero node (RecordBatchReaderSourceNodeOptions) - #50802

Merged
zanmato1984 merged 2 commits into
apache:mainfrom
owenowenisme:owenowenisme/Bind-build-side-table-reuse-in-pyarrow
Aug 13, 2026
Merged

GH-50801: [Python] Expose the record_batch_reader_source Acero node (RecordBatchReaderSourceNodeOptions) #50802
zanmato1984 merged 2 commits into
apache:mainfrom
owenowenisme:owenowenisme/Bind-build-side-table-reuse-in-pyarrow

Conversation

@owenowenisme

@owenowenisme owenowenisme commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

Closes #50801
As title, this exposes RecordBatchReaderSourceNodeOptions to Python. With it, a hash join can build its hash table once and stream the probe side through as a generator-backed RecordBatchReader, releasing each input chunk as it is consumed, instead of materializing the full probe table up front (table_source) or pinning all fragments for the plan's lifetime (dataset scan).

Are these changes tested?

Yes

Are there any user-facing changes?

Yeah, users can pass RecordBatchReaderSourceNodeOptions into Declaration, but its not a breaking change

Signed-off-by: You-Cheng Lin <mses010108@gmail.com>
@owenowenisme
owenowenisme requested a review from AlenkaF as a code owner August 4, 2026 08:58
Copilot AI lite review requested due to automatic review settings August 4, 2026 08:58
@owenowenisme
owenowenisme requested review from raulcd and rok as code owners August 4, 2026 08:58
@owenowenisme owenowenisme changed the title GH-50801 Expose the record_batch_reader_source Acero node (RecordBatchReaderSourceNodeOptions) GH-50801 Expose the record_batch_reader_source Acero node (RecordBatchReaderSourceNodeOptions) Aug 4, 2026
@github-actions github-actions Bot added the awaiting review Awaiting review label Aug 4, 2026
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

⚠️ GitHub issue #50801 has been automatically assigned in GitHub to PR creator.

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.

Pull request overview

Exposes Acero’s record_batch_reader_source node options (RecordBatchReaderSourceNodeOptions) to Python so execution plans can stream data from a pyarrow.RecordBatchReader (including generator-backed readers) instead of requiring fully-materialized tables or dataset scans.

Changes:

  • Added a Cython binding for arrow::acero::RecordBatchReaderSourceNodeOptions and exposed it as pyarrow.acero.RecordBatchReaderSourceNodeOptions.
  • Added Python tests covering basic usage, generator-backed laziness, generator error propagation, and a hash-join probe-side streaming example.
  • Updated Python API docs to include the newly exposed options class.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
python/pyarrow/_acero.pyx Adds the RecordBatchReaderSourceNodeOptions Cython wrapper that constructs the underlying Acero options object.
python/pyarrow/includes/libarrow_acero.pxd Declares arrow::acero::RecordBatchReaderSourceNodeOptions for Cython to construct.
python/pyarrow/acero.py Re-exports the new options class from the _acero extension for public Python use.
python/pyarrow/tests/test_acero.py Adds coverage for streaming source behavior (including generator-backed readers and join integration).
docs/source/python/api/acero.rst Documents the new options class in the public Acero Python API listing.

Comment thread python/pyarrow/_acero.pyx

@Reranko05 Reranko05 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you edit the title to GH-<Issue Number>: [<Component>] <Title>, this will make it easier for maintainers.

@owenowenisme owenowenisme changed the title GH-50801 Expose the record_batch_reader_source Acero node (RecordBatchReaderSourceNodeOptions) GH-50801 [Python] Expose the record_batch_reader_source Acero node (RecordBatchReaderSourceNodeOptions) Aug 5, 2026
@owenowenisme

Copy link
Copy Markdown
Contributor Author

@Reranko05 I updated the title, ty

@owenowenisme

Copy link
Copy Markdown
Contributor Author

@wgtmac @rok
Hi, would you mind taking a look? Thanks!

@rok

rok commented Aug 6, 2026

Copy link
Copy Markdown
Member

This looks ok to me, but I am not familiar with this part of the codebase. Perhaps @wgtmac or @zanmato1984 can review.

@rok
rok requested a review from zanmato1984 August 6, 2026 18:52
@owenowenisme

Copy link
Copy Markdown
Contributor Author

cc @wgtmac too, PTAL thank you!!!

@zanmato1984 zanmato1984 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.

+1. Thanks for working on this!

@owenowenisme

Copy link
Copy Markdown
Contributor Author

@zanmato1984 Thanks for reviewing!

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.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread python/pyarrow/includes/libarrow_acero.pxd
@owenowenisme

Copy link
Copy Markdown
Contributor Author

@zanmato1984 Hi Rossi, can I please get a merge? Thank you!

@zanmato1984

Copy link
Copy Markdown
Contributor

Let's wait for CI then I'll merge. Thanks!

@github-actions github-actions Bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Aug 12, 2026
@zanmato1984 zanmato1984 changed the title GH-50801 [Python] Expose the record_batch_reader_source Acero node (RecordBatchReaderSourceNodeOptions) GH-50801: [Python] Expose the record_batch_reader_source Acero node (RecordBatchReaderSourceNodeOptions) Aug 13, 2026
@zanmato1984

Copy link
Copy Markdown
Contributor

Merging.

@zanmato1984
zanmato1984 merged commit 7128c9c into apache:main Aug 13, 2026
49 of 51 checks passed
@zanmato1984 zanmato1984 removed the awaiting committer review Awaiting committer review label Aug 13, 2026
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.

[Python] Expose the record_batch_reader_source Acero node (RecordBatchReaderSourceNodeOptions)

5 participants