kosiew commented on code in PR #21122:
URL: https://github.com/apache/datafusion/pull/21122#discussion_r3035362272


##########
datafusion/core/src/physical_planner.rs:
##########
@@ -2898,7 +2920,11 @@ impl DefaultPhysicalPlanner {
                     .into_iter()
                     .map(|(expr, alias)| ProjectionExpr { expr, alias })
                     .collect();
-                Ok(Arc::new(ProjectionExec::try_new(proj_exprs, input_exec)?))
+                let mut proj_exec = ProjectionExec::try_new(proj_exprs, 
input_exec)?;

Review Comment:
   Thanks for wiring the analyzer registry into planner-built projections. I 
think there is still one hole here though.
   
   Right now this gets attached when the planner initially creates a 
`ProjectionExec`, but several later paths still rebuild or insert projections 
with plain `ProjectionExec::try_new(...)`, for example in 
`datafusion/physical-plan/src/projection.rs`, 
`datafusion/physical-optimizer/src/projection_pushdown.rs`, and 
`datafusion/physical-optimizer/src/aggregate_statistics.rs`.
   
   After one of those rewrites, expression stats seem to fall back to `unknown` 
again even when `datafusion.optimizer.enable_expression_analyzer = true`.
   
   Could we propagate the registry when cloning or rebuilding projections, or 
store it somewhere rebuilt plan nodes can recover it from? As written, this 
still looks plan-shape dependent after physical optimization.



-- 
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]

Reply via email to