Skip to content

[DISCUSS] Representing Shared State / ExecutionPlan::reset_state #21650

@alamb

Description

@alamb

Is your feature request related to a problem or challenge?

I brought this out into its own discussion so it wasn't lost on a PR comment

@Dandandan observes on #21351 (comment):

I don't like the additions in some recent PRs of reset_state on plans / sources etc.

In my opinion we should avoid setting mutable state on ExecutionPlans (and related data structures) & move that to the inner streams.

In an ideal scenario:

During any time we can clone a plan and share / run it without expecting any side effects (e.g. partially executed plans)
Concurrent runs of a query (ideallyexecutes) should result in the same result, even while a query is running.
In my PR #20481 I combined the shared state using TaskContext (which, in normal usages, will be created on each new query run), which I think still not is 100% the desired end state but avoids a lot of scenario's.

https://github.com/apache/datafusion/pull/20481/files#diff-e3975f93f1d4599fe6f19905e81f02574d65402e604e39c45b87448b3892d1adR70

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions