Skip to content

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?

@comphead comphead requested review from alamb and tustvold October 31, 2023 16:43
///
/// 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

@comphead comphead requested a review from tustvold October 31, 2023 18:16
@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