alamb commented on code in PR #4534:
URL: https://github.com/apache/arrow-datafusion/pull/4534#discussion_r1045216747
##########
datafusion/expr/src/logical_plan/plan.rs:
##########
@@ -1195,13 +1195,17 @@ pub struct SubqueryAlias {
}
impl SubqueryAlias {
- pub fn try_new(plan: LogicalPlan, alias: &str) ->
datafusion_common::Result<Self> {
+ pub fn try_new(
+ plan: LogicalPlan,
+ alias: impl Into<String>,
Review Comment:
This change allows `SubqueryAlias::try_new` to take a `String` if the caller
has one or a `&str` that will be copied into a new String if needed
##########
datafusion/sql/src/planner.rs:
##########
@@ -993,19 +992,19 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
)))
} else {
subquery_alias_owned(
- Self::apply_expr_alias(plan, &alias.columns)?,
- &normalize_ident(&alias.name),
+ Self::apply_expr_alias(plan, alias.columns)?,
+ &normalize_ident(alias.name),
)
}
}
- fn apply_expr_alias(plan: LogicalPlan, idents: &Vec<Ident>) ->
Result<LogicalPlan> {
Review Comment:
This function took a reference but the caller immediately drops the actual
Vec. This PR reuses it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]