zanmato1984 opened a new issue, #45196: URL: https://github.com/apache/arrow/issues/45196
### Describe the enhancement requested Some code in hash join are unnecessary: 1. When building the hash table, we are conditioning if the batch is empty: https://github.com/apache/arrow/blob/438cf9bd2d31506635bc56ca0371df53030ff4d1/cpp/src/arrow/acero/hash_join.cc#L578-L581 and https://github.com/apache/arrow/blob/438cf9bd2d31506635bc56ca0371df53030ff4d1/cpp/src/arrow/acero/swiss_join.cc#L2608 However these can be simplified by returning early when accumulating the build side batch. 2. Some release are unnecessary: https://github.com/apache/arrow/blob/438cf9bd2d31506635bc56ca0371df53030ff4d1/cpp/src/arrow/acero/swiss_join.cc#L2640-L2642 ### Component(s) C++ -- 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: issues-unsubscr...@arrow.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org