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

Minor: add ExecutionPlan.execute() snippet for sync methods #8010

Closed
wants to merge 3 commits into from

Conversation

comphead
Copy link
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

Very often the question arises on debugging or using record stream in sync context. Adding a code snippet for ExecutionPlan.execute()

What changes are included in this PR?

A code snippet

Are these changes tested?

Are there any user-facing changes?

///
/// fn print_plan_exec() -> Result<(), DataFusionError> {
/// let stream = node.execute(0, task_ctx)?;
/// futures::stream::once(async move {
Copy link
Contributor

Choose a reason for hiding this comment

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

This stream gets immediately dropped and therefore will never run?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay, I'll include another use case with amending stream and returning it back to the user. Like in https://github.com/apache/arrow-datafusion/blob/main/datafusion/physical-plan/src/sorts/sort.rs#L895

@tustvold I believe you mean exactly that?

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean as written this example doesn't do anything and is therefore just misleading.

Like in https://github.com/apache/arrow-datafusion/blob/main/datafusion/physical-plan/src/sorts/sort.rs#L895

Yes, that is I think a good example of the pattern

@tustvold
Copy link
Contributor

I tried to encode what I was expecting in #8013 PTAL

@comphead
Copy link
Contributor Author

Closed in favor of #8013

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