Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Pull based native execution #69

Merged
merged 1 commit into from
Feb 21, 2024
Merged

Conversation

viirya
Copy link
Member

@viirya viirya commented Feb 21, 2024

Which issue does this PR close?

Closes #70.

Rationale for this change

Comet native execution's scan is not started from native but from JVM. Thus Comet scan is push-based instead of pull-based. Although we pull next input batches from child operator in JVM, this new input is not pulled from native but pushed from JVM side.

For an operator like Expand, one input batch can produces multiple output batches. So we cannot pull next batch directly and push into native without peeking it. We need to "peek" into native side and see if any more output batch there. If so, we take it as next output, if not, we pull next input batch and push into native side to execute on it.

If we pull next input from child operator and push it into native without peek, new input will be ignored.

Not only we cannot have consistent way to get input for native operators. The code of input/output to native execution is harder to understand because we mix push-based and pull-based processing modes. This patch tries to make native execution fully pull-based.

What changes are included in this PR?

How are these changes tested?

Passed existing tests and e2e tests.

@viirya
Copy link
Member Author

viirya commented Feb 21, 2024

This is ported from internal patch.

Copy link
Member

@sunchao sunchao left a comment

Choose a reason for hiding this comment

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

LGTM. This has been reviewed internally.

@viirya viirya merged commit 22634d2 into apache:main Feb 21, 2024
6 checks passed
@viirya
Copy link
Member Author

viirya commented Feb 21, 2024

Merged. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pull based native execution
2 participants