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: avoid copying order by exprs in planner #11634

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Jul 24, 2024

Which issue does this PR close?

N/A

Rationale for this change

While working on #11630 I noticed some cloning in SQL planning that could be avoided

What changes are included in this PR?

Stop cloning oby_expr

Are these changes tested?

Existing CI

Are there any user-facing changes?

No, this is internal only

@@ -87,11 +87,9 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
input_schema.qualified_field(field_index - 1),
))
}
e => self.sql_expr_to_logical_expr(
e.clone(),
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 the clone that is avoided.

@@ -37,7 +37,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
/// If false, interpret numeric literals as constant values.
pub(crate) fn order_by_to_sort_expr(
&self,
exprs: &[OrderByExpr],
exprs: Vec<OrderByExpr>,
Copy link
Contributor Author

@alamb alamb Jul 24, 2024

Choose a reason for hiding this comment

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

The internal API changes to take the owned Vec rather than a slice

@alamb alamb marked this pull request as ready for review July 24, 2024 16:31
@alamb alamb merged commit bcf715c into apache:main Jul 24, 2024
24 of 25 checks passed
@alamb
Copy link
Contributor Author

alamb commented Jul 24, 2024

Thanks @Dandandan

@alamb alamb deleted the alamb/less_clone branch July 24, 2024 19:22
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