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

Derive Clone for more ExecutionPlans #13203

Merged
merged 3 commits into from
Nov 2, 2024
Merged

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Oct 31, 2024

Which issue does this PR close?

Closes # #13202

Rationale for this change

See #13202

What changes are included in this PR?

  1. Add Clone for other ExecutionPlans

Note there are some ExecutionPlans that are not clonable (like HashJoinExec) because they have some shared state (a once_fut used to coordinate amongst threads). It was hard to see how to add Clone to those so I left it alone but left a comment for future readers

Are these changes tested?

By existing CI tests

Are there any user-facing changes?

@github-actions github-actions bot added the physical-expr Physical Expressions label Oct 31, 2024
@alamb alamb marked this pull request as ready for review October 31, 2024 14:58
Copy link
Member

@findepi findepi left a comment

Choose a reason for hiding this comment

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

IMO we should make fields public instead.
See #13202 (comment)

@@ -293,7 +293,7 @@ impl JoinLeftData {
/// │ "dimension" │ │ "fact" │
/// └───────────────┘ └───────────────┘
/// ```
#[derive(Debug)]
#[derive(Debug)] // note not Clone because of the OnceAsync
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be amazing to clarify what is OnceAsync and why clone is not fit for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will try

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is my attempt: #13223

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, in that case we can highlight it in doc? OnceAsync

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea -- I tried to clarify in b5ffef0

@alamb
Copy link
Contributor Author

alamb commented Nov 1, 2024

IMO we should make fields public instead. See #13202 (comment)

I am not sure making the fields pub really solves my usecase -- namely that I have a &SortExec (ref to a SortExec that is really in an Arc<..>) and I want to make a modified copy of it.

Even if the fields are pub I still couldn't change them.

I don't have a strong preference one way or the other over pub fields (or mut accessors like set_preserve_partitions())

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

thanks @alamb 💪

@alamb
Copy link
Contributor Author

alamb commented Nov 2, 2024

🚀

@alamb alamb merged commit 89e96b4 into apache:main Nov 2, 2024
24 checks passed
@alamb alamb deleted the alamb/exec_clone branch November 4, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
physical-expr Physical Expressions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants