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


##########
datafusion/physical-plan/src/filter.rs:
##########
@@ -401,8 +401,11 @@ impl FilterExec {
             }
         };
 
-        let total_byte_size =
-            input_total_byte_size.with_estimated_selectivity(selectivity);
+        let total_byte_size = if is_infeasible {

Review Comment:
   That's true, and the per-column `byte_size` had the same problem, so I 
decided to handle them both via a common helper (`scale_byte_size_at_rows`), 
implemented in 
[9f09c54](https://github.com/apache/datafusion/pull/24000/commits/9f09c54d822d828e4b7648db56ffac09b19f337a).
   
   That helper returns `Exact(0)` when the filtered row count is `Exact(0)` 
(when `is_infeasible` holds, we set the row count to `Exact(0)`, so calling the 
helper is enough and we don't need the special condition anymore).
   
   These changes (`Absent` and `Inexact` byte sizes) are covered by the new 
`test_filter_statistics_exact_empty_input_zeroes_byte_size`.



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