alamb commented on code in PR #13187: URL: https://github.com/apache/datafusion/pull/13187#discussion_r1826260061
########## datafusion/physical-plan/src/joins/hash_join.rs: ########## @@ -780,24 +780,15 @@ impl ExecutionPlan for HashJoinExec { // TODO stats: it is not possible in general to know the output size of joins // There are some special cases though, for example: // - `A LEFT JOIN B ON A.col=B.col` with `COUNT_DISTINCT(B.col)=COUNT(B.col)` - let mut stats = estimate_join_statistics( + let stats = estimate_join_statistics( Arc::clone(&self.left), Arc::clone(&self.right), self.on.clone(), &self.join_type, &self.join_schema, )?; // Project statistics if there is a projection - if let Some(projection) = &self.projection { - stats.column_statistics = stats Review Comment: this code also appears to assume projections never contain repeated values 🤔 I can try and improve the statistics calculation in a future PR to avoid cloning -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org