-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 unnecessary clone in datafusion_proto #7921
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -394,17 +394,12 @@ impl AsExecutionPlan for PhysicalPlanNode { | |
vec![] | ||
}; | ||
|
||
let input_schema = hash_agg | ||
.input_schema | ||
.as_ref() | ||
.ok_or_else(|| { | ||
DataFusionError::Internal( | ||
"input_schema in AggregateNode is missing.".to_owned(), | ||
) | ||
})? | ||
.clone(); | ||
let physical_schema: SchemaRef = | ||
SchemaRef::new((&input_schema).try_into()?); | ||
let input_schema = hash_agg.input_schema.as_ref().ok_or_else(|| { | ||
DataFusionError::Internal( | ||
"input_schema in AggregateNode is missing.".to_owned(), | ||
) | ||
})?; | ||
let physical_schema: SchemaRef = SchemaRef::new(input_schema.try_into()?); | ||
Comment on lines
-397
to
+402
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The SchemaRef seems able create from ref of input_schema. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I is confusing, but There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The This really confusing me at first glance, it's consume a I don't understand why these convert trait methods convert into And I just notice this line could be replaced by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree it is confusing. Any help to make it better would be most appreciated |
||
|
||
let physical_filter_expr = hash_agg | ||
.filter_expr | ||
|
@@ -489,7 +484,7 @@ impl AsExecutionPlan for PhysicalPlanNode { | |
physical_filter_expr, | ||
physical_order_by_expr, | ||
input, | ||
Arc::new((&input_schema).try_into()?), | ||
Arc::new(input_schema.try_into()?), | ||
)?)) | ||
} | ||
PhysicalPlanType::HashJoin(hashjoin) => { | ||
|
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.
May be returned early and the clone could be avoided.