Skip to content

Commit

Permalink
[fix](datastream sender) fix wrong result of BUCKET_SHFFULE_HASH_PART…
Browse files Browse the repository at this point in the history
…ITIONED shuffle (#22973)

fix wrong result of BUCKET_SHFFULE_HASH_PARTITIONED shuffle
  • Loading branch information
jacktengg authored Aug 15, 2023
1 parent 911bd0e commit 8318dfa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions be/src/vec/sink/vdata_stream_sender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,9 @@ Status VDataStreamSender::send(RuntimeState* state, Block* block, bool eos) {

// vectorized calculate hash
int rows = block->rows();
auto element_size = _channels.size();
auto element_size = _part_type == TPartitionType::HASH_PARTITIONED
? _channels.size()
: _channel_shared_ptrs.size();
std::vector<uint64_t> hash_vals(rows);
auto* __restrict hashes = hash_vals.data();

Expand Down Expand Up @@ -630,7 +632,6 @@ Status VDataStreamSender::send(RuntimeState* state, Block* block, bool eos) {
.first->update_crcs_with_value(
hash_vals, _partition_expr_ctxs[j]->root()->type().type);
}
element_size = _channel_shared_ptrs.size();
for (int i = 0; i < rows; i++) {
hashes[i] = hashes[i] % element_size;
}
Expand Down

0 comments on commit 8318dfa

Please sign in to comment.