Skip to content

[C++][Acero] Add pipe_sink, pipe_source and pipe_tee nodes to enable more complex execution plans and query batching. #45434

Open

Description

@gitmodimo

Describe the enhancement requested

I have been experimenting with the concept of pipe in Acero. It show great potential in expanding Acero flexibility and features. Initial draft and proof of concept implementation is available here: PR-45435

Consider named_pipe that:

  • has one sink (pipe_sink or pipe_tee)
  • has multiple sources (pipe_source)
  • each ExecBatch that enters sink (pipe_sink/pipe_tee) is duplicated to all of its outputs (pipe_source)
  • sinks are matched with sources by pipe_name in Init phase of exec plan

pipe_sink - is a sink node that consumes RecordBatches and duplicates them onto all pipe_sources that match by name.
pipe_tee - works exactly as pipe_sink and additionally forwards the batch to its output
pipe_source - is pipe consumer node that can be considered as source node in terms of declaration

Example of new flexibility given new nodes:

Declaration main_query= Declaration::Sequence({
     {"source", ...},
     {"pipe_tee", PipeSinkNodeOptions{"named_pipe_1"}},
     {"filter", FilterNodeOptions{expr1},
     {"sink", ...}
});

Declaration extra_query= Declaration::Sequence({
     {"pipe_source", PipeSourceNodeOptions{"named_pipe_1", schema}}
     {"filter", FilterNodeOptions{expr2},
     {"sink", ...}
});
...
main_query.AddToPlan(plan.get());
extra_query.AddToPlan(plan.get());

Things left to do:

  • refactor the code and add pipe_sink
  • handle instances of pipe_sources consumers that do not have corresponding producers - produce error
  • probably more tests
  • update doc

Let me know what you think about this feature and whether there are any pitfalls that I missed. What additional test cases should I implement?

Component(s)

C++

Activity

  1. gitmodimo commented on Feb 11, 2025

    @gitmodimo
    ContributorAuthor

    I am pretty content with current implementation of pipe. In addition to enabling tee nodes I found additional use for Pipe to produce additional outputs for user defined acero nodes.
    Please advise if you see pipes fit for acero. If so I will update PR with docs and probably some clean-up in tests.

  2. gitmodimo commented on Aug 21, 2025

    @gitmodimo
    ContributorAuthor

    I will convert to draft until #47385 is complete. Backpressure unification can be applied here.

  3. github-actions commented on Aug 21, 2026

    @github-actions

    This issue has been marked as stale because it has had no activity in the past 365 days. Please remove the stale label or comment below, or this issue will be closed in 14 days. If this improvement is still desired but has no current owner, please add the 'Status: needs champion' label.

  4. added
    Status: stale-warningIssues and PRs flagged as stale which are due to be closed if no indication otherwise
    on Aug 21, 2026
  5. gitmodimo commented on Aug 24, 2026

    @gitmodimo
    ContributorAuthor

    PR waiting on #47385

  6. removed
    Status: stale-warningIssues and PRs flagged as stale which are due to be closed if no indication otherwise
    on Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions