yyy1000 commented on PR #8779:
URL: 
https://github.com/apache/arrow-datafusion/pull/8779#issuecomment-1883621059

   > I think your implementation will somewhere have to use the relative sizes 
of `key` and `values` -- so maybe something like
   > 
   > ```rust
   > pub fn estimated_hashtable_size<K, V>(len: usize) -> usize {
   > ...
   > }
   > ```
   
   Maybe we don't need the 'key' and 'value' if simply calculate the size by
   ```rust
   pub fn estimated_hashtable_size(len: usize) -> usize {
       (len.checked_mul(8).unwrap_or(usize::MAX) / 7).next_power_of_two()
   }
   ```
   What do you think? 🤔
   
   > If this PR is getting too complicated, perhaps it was a poor choice to 
suggest as a good first project. 
   
   No worry, I can finish it. 😎
   
   > Perhaps we could move the size calculation into `datafusion_common` (or 
into physical-expr)
   
   Good idea!
   
   


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

Reply via email to