gabotechs opened a new issue, #20779:
URL: https://github.com/apache/datafusion/issues/20779

   ### Describe the bug
   
   `max_distinct_count` in `datafusion/physical-plan/src/joins/utils.rs` panics 
with "attempt to subtract with overflow" in the `Precision::Exact` branch (line 
725):
   
   ```rust
   Precision::Exact(count) => {
       let count = count - stats.null_count.get_value().unwrap_or(&0); // <-- 
panic
   ```
   
   This happens when `num_rows` (Exact) is smaller than `null_count`, which 
became possible after #20228 ("Push limit into hash join").
   
   
   ### To Reproduce
   
   ```
   git clone https://github.com/datafusion-contrib/datafusion-distributed
   cd datafusion-distributed
   git checkout branch-53
   cargo test --test tpcds_plans_test tests::test_tpcds_19 --all-features
   ```
   
   ### Expected behavior
   
   No substraction overflow
   
   ### Additional context
   
   _No response_


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