HappenLee commented on a change in pull request #4677:
URL: https://github.com/apache/incubator-doris/pull/4677#discussion_r495566516
##########
File path: be/src/runtime/data_stream_sender.cpp
##########
@@ -479,7 +495,30 @@ Status DataStreamSender::send(RuntimeState* state,
RowBatch* batch) {
hash_val = RawValue::get_hash_value_fvn(
partition_val, ctx->root()->type(), hash_val);
}
- RETURN_IF_ERROR(_channels[hash_val % num_channels]->add_row(row));
+ auto target_channel_id = hash_val % num_channels;
+ RETURN_IF_ERROR(_channels[target_channel_id]->add_row(row));
+ }
+ } else if (_part_type == TPartitionType::BUCKET_SHFFULE_HASH_PARTITIONED) {
+ // hash-partition batch's rows across channels
+ int num_channels = _channel_shared_ptrs.size();
+
+ for (int i = 0; i < batch->num_rows(); ++i) {
+ TupleRow* row = batch->get_row(i);
+ size_t hash_val = 0;
+
+ for (auto ctx : _partition_expr_ctxs) {
+ void* partition_val = ctx->get_value(row);
+ // We can't use the crc hash function here because it does not
result
+ // in uncorrelated hashes with different seeds. Instead we
must use
+ // fvn hash.
+ // TODO: fix crc hash/GetHashValue()
+ //hash_val = RawValue::get_hash_value_fvn(
+ // partition_val, ctx->root()->type(), hash_val);
+ hash_val = RawValue::zlib_crc32(
Review comment:
This comment is not right, I will change this part.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]