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


##########
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:
   This is a known limitation under the constraint of avoiding breaking changes 
entirely in this first PR: only the planner has access to `SessionState`, so 
operator nodes created later by optimizer rules don't receive the registry. The 
idea was to lift the limitation via an operator-level statistics registry (see 
#21443, which would be the second and final part of the pluggable design for 
statistics).
   
   The limitation is documented in 
[`ProjectionExprs::with_expression_analyzer_registry`](https://github.com/apache/datafusion/pull/21122/files#diff-0a88c8919b631d43ef9be55ec2811b3ed23ec966cef8aff9786c1f1650a3d5b4R201)
 and 
[`FilterExecBuilder::with_expression_analyzer_registry`](https://github.com/apache/datafusion/pull/21122/files#diff-ae492510820d46b07e2d7420f4555fcb005408682bf3e8aed85faad7925d4545R185).
   
   Apologies for having you figure it out independently, I should have called 
this out more prominently in the PR description rather than only in code 
comments.
   
   If you see a better way to propagate the registry that I might have 
overlooked or if you think a breaking change is the right call here, I'd be 
happy to hear more about that.



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