Skip to content

Draft: implement non-blocking morsel API - #21852

Closed
alamb wants to merge 1 commit into
apache:mainfrom
alamb:alamb/non_block_morsels
Closed

Draft: implement non-blocking morsel API#21852
alamb wants to merge 1 commit into
apache:mainfrom
alamb:alamb/non_block_morsels

Conversation

@alamb

@alambalamb commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

TODO

  • Tests
  • Make a PR to refactor the large poll_scan loop into separate functions to reduce the indent level / control flow

Which issue does this PR close?

Rationale for this change

In #21342 (comment), @adriangb pointed out that the current Morsel API relied on a comment rather than they typesystem to separate IO and CPU.

Also, it should be pointed out that the current Parquet opener actually does now do IO in the stream reader. This makes overlapping the IO and CPU harder

What changes are included in this PR?

  1. Change the signature of Morsel::into_stream to return either a Sync or Async stream.
  2. Adjust parquet reader

I don't expect this change will have much of an actual impact (yet) but I do expect that it will set us up for better IO interleaving / work stealing

Are these changes tested?

yes by CI and new tests (to be written)

Are there any user-facing changes?

The unreleased Morsel API is slightly different

@alamb
alambforce-pushed the alamb/non_block_morsels branch from 7291951 to ad17058CompareMay 21, 2026 10:47
@adriangb

Copy link
Copy Markdown
Contributor

@alamb is this something I could help push forward, if you still think it's the right direction? I'm happy to review, etc. Just going through your open PRs to see what I can help with.

@alamb

Copy link
Copy Markdown
ContributorAuthor

@alamb is this something I could help push forward, if you still think it's the right direction? I'm happy to review, etc. Just going through your open PRs to see what I can help with.

Thank you for the ping.

Basically I think to be motivated to move this along I need to find some query where it improves performance. I didn't have such evidence and thus is dropped off my radar.

So in other words, I am not sure what to do with this -- I think it basically "realizes the vision" of morsel driven API but just makes the code more complicated and has no direct benefit yet 🤔

@github-actions

Copy link
Copy Markdown

Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.

@github-actionsgithub-actionsBot added the Stale PR has not had any activity for some time label Aug 10, 2026
@alambalamb closed this Aug 11, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

datasourceChanges to the datasource crateStalePR has not had any activity for some time

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Morsel output for Parquet known to be non blocking

2 participants

@alamb@adriangb