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


##########
datafusion/physical-plan/src/operator_statistics/mod.rs:
##########
@@ -782,9 +779,16 @@ impl StatisticsProvider for JoinStatisticsProvider {
             return Ok(StatisticsResult::Delegate);
         };
 
-        use crate::joins::JoinOnRef;
+        let default_analyzer;
+        let analyzer = match plan.expression_analyzer_registry() {

Review Comment:
   Thanks @kosiew, I have addressed both points in the latest two commits:
   
   1. initial injection gap: my first idea was that if no rule ever modifies 
the plan, we might not need the injection step, but injecting before the 
optimizer loop is more consistent and safer, so I have added it
   
   2. `JoinStatisticsProvider` config bypass: I have removed the fresh creation 
of `ExpressionAnalyzerRegistry` which was indeed violating the contract of the 
`use_expression_analyzer` config flag. The provider now uses the injected 
registry when present, and falls back to direct `ColumnStatistics` lookup for 
bare column keys when not (preserving the behavior as of #21483 when 
`use_expression_analyzer` is false, as expected).
   
   EDIT: CI 
[failure](https://github.com/apache/datafusion/actions/runs/24509459889/job/71637302277?pr=21122#step:7:115)
 looks unrelated:
   
   ```
   $ sudo apt-get update
   $ sudo apt-get install -y protobuf-compiler
   [...]
   Err:66 http://security.ubuntu.com/ubuntu noble-security/restricted 
Translation-en
   File has unexpected size (653824 != 658356). Mirror sync in progress? [IP: 
91.189.91.81 80]
   [...]
   ```



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