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

Add ability to execute ExecutionPlan and get a stream of RecordBatch #186

Merged
merged 4 commits into from
Feb 16, 2023

Conversation

andygrove
Copy link
Member

@andygrove andygrove commented Feb 16, 2023

Which issue does this PR close?

N/A

Rationale for this change

Allow Python code to execute a Rust ExecutionPlan and fetch the stream of batches.

What changes are included in this PR?

Are there any user-facing changes?

@andygrove andygrove changed the title Add PyExectionPlan.execute method Add ability to execute ExecutionPlan and get a stream of RecordBatch Feb 16, 2023
@andygrove andygrove marked this pull request as ready for review February 16, 2023 02:37
Copy link
Contributor

@jdye64 jdye64 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Andy

use futures::StreamExt;
use pyo3::{pyclass, pymethods, PyObject, PyResult, Python};

#[pyclass(name = "RecordBatch", module = "datafusion", subclass)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Eventually I want to add a datafusion.arrow module but I don't quite have all the pieces in place for that yet.

py: Python,
) -> PyResult<PyRecordBatchStream> {
let ctx = Arc::new(TaskContext::new(
"task_id".to_string(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Created an issue for more general configuration setup #187

@andygrove andygrove merged commit 9ee424e into apache:main Feb 16, 2023
@andygrove andygrove deleted the py-execute-plan branch February 16, 2023 15:25
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.

2 participants