Dandandan commented on code in PR #20730:
URL: https://github.com/apache/datafusion/pull/20730#discussion_r2892398034


##########
datafusion/physical-optimizer/src/join_selection.rs:
##########
@@ -87,16 +87,18 @@ fn supports_collect_by_thresholds(
     threshold_byte_size: usize,
     threshold_num_rows: usize,
 ) -> bool {
-    // Currently we do not trust the 0 value from stats, due to stats 
collection might have bug
-    // TODO check the logic in datasource::get_statistics_with_limit()
     let Ok(stats) = plan.partition_statistics(None) else {
         return false;
     };
 
+    // Stats use `Precision<T>` to represent stats, where `Absent` means 
unknown.
+    // `Exact(0)` and `Inexact(0)` are both valid stats, and we should not 
treat
+    // them as unknown, `Absent` will return false (this is in regards to why

Review Comment:
   ```suggestion
       // them as unknown, `Absent` will return None (this is in regards to why
   ```



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