HappenLee commented on code in PR #31689:
URL: https://github.com/apache/doris/pull/31689#discussion_r1520876334


##########
be/src/pipeline/exec/exchange_sink_operator.cpp:
##########
@@ -398,6 +458,47 @@ Status ExchangeSinkOperatorX::sink(RuntimeState* state, 
vectorized::Block* block
                     state, local_state.channel_shared_ptrs, 
local_state._partition_count,
                     (uint32_t*)local_state._partitioner->get_channel_ids(), 
rows, block, eos));
         }
+    } else if (_part_type == TPartitionType::TABLET_SINK_SHUFFLE_PARTITIONED) {
+        // check out of limit
+        RETURN_IF_ERROR(local_state._send_new_partition_batch());
+        std::shared_ptr<vectorized::Block> convert_block = 
std::make_shared<vectorized::Block>();
+        const auto& num_channels = local_state._partition_count;
+        std::vector<std::vector<uint32>> channel2rows;
+        channel2rows.resize(num_channels);
+        auto input_rows = block->rows();
+
+        if (input_rows > 0) {
+            bool has_filtered_rows = false;
+            int64_t filtered_rows = 0;
+            local_state._number_input_rows += input_rows;
+
+            
RETURN_IF_ERROR(local_state._row_distribution.generate_rows_distribution(
+                    *block, convert_block, filtered_rows, has_filtered_rows,
+                    local_state._row_part_tablet_ids, 
local_state._number_input_rows));
+
+            const auto& row_ids = local_state._row_part_tablet_ids[0].row_ids;
+            const auto& tablet_ids = 
local_state._row_part_tablet_ids[0].tablet_ids;
+            auto select_rows = row_ids.size();
+            std::vector<uint32_t> crc_hash_vals(select_rows);
+            auto* __restrict crc_hashes = crc_hash_vals.data();
+            for (size_t i = 0; i < select_rows; i++) {
+                crc_hashes[i] =
+                        HashUtil::zlib_crc_hash(&tablet_ids[i], sizeof(int64), 
crc_hashes[i]);
+            }

Review Comment:
   tablet_ids[i] =
                           HashUtil::zlib_crc_hash(&tablet_ids[i], 
sizeof(int64), 0);



-- 
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: commits-unsubscr...@doris.apache.org

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


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

Reply via email to