zanmato1984 commented on code in PR #45515:
URL: https://github.com/apache/arrow/pull/45515#discussion_r1957857635
##########
cpp/src/arrow/acero/swiss_join.cc:
##########
@@ -696,17 +697,18 @@ void SwissTableMerge::MergePartition(SwissTable* target,
const SwissTable* sourc
}
}
-inline bool SwissTableMerge::InsertNewGroup(SwissTable* target, uint64_t
group_id,
- uint32_t hash, int64_t
max_block_id) {
+inline bool SwissTableMerge::InsertNewGroup(SwissTable* target, uint32_t
group_id,
+ uint32_t hash, uint32_t
max_block_id) {
// Load the first block to visit for this hash
//
- int64_t block_id = hash >> (SwissTable::bits_hash_ - target->log_blocks());
- int64_t block_id_mask = ((1LL << target->log_blocks()) - 1);
+ uint32_t block_id = SwissTable::block_id_from_hash(hash,
target->log_blocks());
+ uint32_t block_id_mask = (1 << target->log_blocks()) - 1;
Review Comment:
The `log_blocks()` is guaranteed to be <= `29`: the maximum of number of
rows of a swiss table is `2^32` (we already have many guards on this), and each
block contains `8` rows/slots. So the UB won't be happening.
--
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]