From fb23f410f423b9905a1756e94412e4d3b88d7fdb Mon Sep 17 00:00:00 2001 From: Mryange <59914473+Mryange@users.noreply.github.com> Date: Fri, 25 Oct 2024 12:47:48 +0800 Subject: [PATCH] [refine](exchange)remove template in ExchangeSinkOperatorX::channel_add_rows (#42425) --- be/src/pipeline/exec/exchange_sink_operator.cpp | 15 +++++++-------- be/src/pipeline/exec/exchange_sink_operator.h | 15 ++++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/be/src/pipeline/exec/exchange_sink_operator.cpp b/be/src/pipeline/exec/exchange_sink_operator.cpp index e138cf010b624f..3f12b4458cdbde 100644 --- a/be/src/pipeline/exec/exchange_sink_operator.cpp +++ b/be/src/pipeline/exec/exchange_sink_operator.cpp @@ -659,11 +659,10 @@ void ExchangeSinkLocalState::register_channels(pipeline::ExchangeSinkBuffer* buf } } -template -Status ExchangeSinkOperatorX::channel_add_rows(RuntimeState* state, Channels& channels, - int num_channels, - const HashValueType* __restrict channel_ids, - int rows, vectorized::Block* block, bool eos) { +Status ExchangeSinkOperatorX::channel_add_rows( + RuntimeState* state, std::vector>& channels, + int num_channels, const uint32_t* __restrict channel_ids, int rows, + vectorized::Block* block, bool eos) { std::vector> channel2rows; channel2rows.resize(num_channels); for (uint32_t i = 0; i < rows; i++) { @@ -675,10 +674,10 @@ Status ExchangeSinkOperatorX::channel_add_rows(RuntimeState* state, Channels& ch return Status::OK(); } -template Status ExchangeSinkOperatorX::channel_add_rows_with_idx( - RuntimeState* state, Channels& channels, int num_channels, - std::vector>& channel2rows, vectorized::Block* block, bool eos) { + RuntimeState* state, std::vector>& channels, + int num_channels, std::vector>& channel2rows, + vectorized::Block* block, bool eos) { Status status = Status::OK(); for (int i = 0; i < num_channels; ++i) { if (!channels[i]->is_receiver_eof() && !channel2rows[i].empty()) { diff --git a/be/src/pipeline/exec/exchange_sink_operator.h b/be/src/pipeline/exec/exchange_sink_operator.h index 689172dfc6b9a6..6b936d4b12ce11 100644 --- a/be/src/pipeline/exec/exchange_sink_operator.h +++ b/be/src/pipeline/exec/exchange_sink_operator.h @@ -232,13 +232,14 @@ class ExchangeSinkOperatorX final : public DataSinkOperatorX void _handle_eof_channel(RuntimeState* state, ChannelPtrType channel, Status st); - template - Status channel_add_rows(RuntimeState* state, Channels& channels, int num_channels, - const HashValueType* channel_ids, int rows, vectorized::Block* block, - bool eos); - - template - Status channel_add_rows_with_idx(RuntimeState* state, Channels& channels, int num_channels, + Status channel_add_rows(RuntimeState* state, + std::vector>& channels, + int num_channels, const uint32_t* channel_ids, int rows, + vectorized::Block* block, bool eos); + + Status channel_add_rows_with_idx(RuntimeState* state, + std::vector>& channels, + int num_channels, std::vector>& channel2rows, vectorized::Block* block, bool eos); RuntimeState* _state = nullptr;