-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: Remove more clones from the planner #4546
Conversation
685e75c
to
ee5c4c4
Compare
use std::sync::Arc; | ||
|
||
/// Create a column expression based on a qualified or unqualified column name | ||
pub fn col(ident: &str) -> Expr { | ||
/// | ||
/// example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is demonstrating you can still call col
with a &str
but now also with a String
or &String
to allow backwards compatibility as well as reuse
@@ -70,7 +71,7 @@ impl Column { | |||
// name | |||
Column { | |||
relation: None, | |||
name: String::from(flat_name), | |||
name: flat_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would always clone previously, and now it allows the caller to pass in a String
if they have one and avoid the clone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job, thanks @alamb ❤️
Benchmark runs are scheduled for baseline = 0de7d81 and contender = 1ddcafe. 1ddcafe is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Draft as it builds on #4534Which issue does this PR close?
N/A
Rationale for this change
Less cloning is better
What changes are included in this PR?
Allow
subquery_alias
andsubquery_alias_owned
to take an existingString
rather than always copying itAre these changes tested?
Covered by existing tests
Are there any user-facing changes?
No