jonathanc-n opened a new pull request, #16434:
URL: https://github.com/apache/datafusion/pull/16434

   ## Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and 
enhancements and this helps us generate change logs for our releases. You can 
link an issue to this PR using the GitHub syntax. For example `Closes #123` 
indicates that this PR will close issue #123.
   -->
   
   - Closes #16179 .
   
   ## Rationale for this change
   We can use `u32` indices instead of `u64` indices when there are less than 
`u32::MAX` rows when building the hashmap. This acts as a memory optimization
   <!--
    Why are you proposing this change? If this is already explained clearly in 
the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your 
changes and offer better suggestions for fixes.  
   -->
   
   ## What changes are included in this PR?
   During `HashJoinExec` we construct the `JoinLeftData` with a `Box<dyn 
JoinHashMapType>` choosing between a u32 indice or u64 `JoinHashMap`. 
   
   I changed the `JoinHashMapType` to hold the `update_from_iter`, 
`get_matched_indice`, and `get_matched_indices_with_limit_offset` and split the 
`JoinHashMap` into `JoinHashMapU32` and `JoinHashMapU64`. 
   
   I deliberately did not try to expose a generic in the trait, nor did I try 
to create a generic on the `JoinHashMap` struct as doing so would lead to many 
problems with having to call preceding functions with a generic; doing so is 
not possible since we are determining the `JoinHashMapType` during runtime. 
   <!--
   There is no need to duplicate the description in the issue here but it is 
sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   ## Are these changes tested?
   Yes I added a test for checking the hashmap created using u32 indices.
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are 
they covered by existing tests)?
   -->
   
   
   


-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to