hcrosse commented on code in PR #27627:
URL: https://github.com/apache/datafusion/pull/27627#discussion_r4650196120


##########
datafusion/physical-plan/src/filter.rs:
##########
@@ -1742,8 +1762,15 @@ fn null_check_statistics(
         })
     };
     stats.total_byte_size = scale_bytes(stats.total_byte_size);
-    for column_stats in &mut stats.column_statistics {
-        column_stats.null_count = cap_at_rows(column_stats.null_count, 
num_rows);
+    for (column_stats, input_null_count) in
+        stats.column_statistics.iter_mut().zip(input_null_counts)
+    {
+        column_stats.null_count = selectivity.map_or_else(
+            || cap_at_rows(input_null_count, num_rows),

Review Comment:
   Preserved `Precision::Exact(0)` in the `None` selectivity fallback and added 
a test case for unknown input rows.



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