alamb commented on code in PR #24226:
URL: https://github.com/apache/datafusion/pull/24226#discussion_r3753453870
##########
datafusion/physical-expr/src/projection.rs:
##########
@@ -69,6 +69,12 @@ impl PartialEq for ProjectionExpr {
impl Eq for ProjectionExpr {}
+impl AsRef<Arc<dyn PhysicalExpr>> for ProjectionExpr {
Review Comment:
maybe worth adding a comment here explaining what this does
##########
datafusion/physical-plan/src/projection.rs:
##########
@@ -334,14 +334,7 @@ impl ExecutionPlan for ProjectionExec {
&self,
f: &mut dyn FnMut(&Arc<dyn PhysicalExpr>) -> Result<TreeNodeRecursion>,
) -> Result<TreeNodeRecursion> {
- crate::apply_expression_roots(
- self.projector
- .projection()
- .as_ref()
- .iter()
- .map(|proj_expr| &proj_expr.expr),
- f,
- )
+
crate::apply_expression_roots(self.projector.projection().as_ref().iter(), f)
Review Comment:
it does look nicer
Though I admit perhaps the magic required to make it work reduces some of
its value
##########
datafusion/physical-plan/src/execution_plan.rs:
##########
Review Comment:
I think as long as it is clear what the traits are for and it makes
downstream code easier to copy/paste/ work it would be ok
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]