Skip to content

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

Merged
andygrove merged 4 commits into
apache:mainfrom
andygrove:py-execute-plan
Feb 16, 2023
Merged

Add ability to execute ExecutionPlan and get a stream of RecordBatch#186
andygrove merged 4 commits into
apache:mainfrom
andygrove:py-execute-plan

Conversation

@andygrove

@andygroveandygrove commented Feb 16, 2023

Copy link
Copy Markdown
Member

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?

@andygroveandygrove changed the title Add PyExectionPlan.execute methodAdd ability to execute ExecutionPlan and get a stream of RecordBatchFeb 16, 2023
@andygrove
andygrove marked this pull request as ready for review February 16, 2023 02:37

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

LGTM, thanks Andy

Comment threadsrc/record_batch.rs
use futures::StreamExt;
use pyo3::{pyclass, pymethods, PyObject, PyResult, Python};

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

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.

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

Comment threadsrc/context.rs
py: Python,
) -> PyResult<PyRecordBatchStream> {
let ctx = Arc::new(TaskContext::new(
"task_id".to_string(),

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.

Created an issue for more general configuration setup #187

@andygrove
andygrove merged commit 9ee424e into apache:mainFeb 16, 2023
@andygrove
andygrove deleted the py-execute-plan branch February 16, 2023 15:25
Sign up for freeto 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

@andygrove@jdye64