yiguolei commented on code in PR #45375: URL: https://github.com/apache/doris/pull/45375#discussion_r1946307320
########## be/src/pipeline/exec/exchange_sink_operator.cpp: ########## @@ -165,11 +190,42 @@ Status ExchangeSinkLocalState::init(RuntimeState* state, LocalSinkStateInfo& inf ? config::table_sink_partition_write_min_data_processed_rebalance_threshold : config::table_sink_partition_write_min_data_processed_rebalance_threshold / state->task_num()); - + if (num_dests != 1) { + _exchanger = ShuffleExchanger<SerializedBlockQueue<PartitionedBlock>>::create_shared( + 1, num_dests, num_dests, free_block_limit); + _channel_selector = std::make_unique<SelectedChannelsSelector>(channels.size()); + } + break; + case TPartitionType::UNPARTITIONED: + break; + case TPartitionType::RANDOM: + if (num_dests != 1) { + _channel_selector = std::make_unique<RoundRobinSelector>(channels.size()); + _exchanger = + PassthroughExchanger<SerializedBlockQueue<BlockWrapperSPtr>>::create_shared( + 1, num_dests, free_block_limit); + _could_be_moved = local_size > 0; + } + break; + case TPartitionType::TABLE_SINK_RANDOM_PARTITIONED: + if (num_dests != 1) { + _channel_selector = std::make_unique<TableSinkRandomSelector>(channels.size()); + _exchanger = + PassthroughExchanger<SerializedBlockQueue<BlockWrapperSPtr>>::create_shared( + 1, num_dests, free_block_limit); + _could_be_moved = local_size > 0; + } + break; + default: + return Status::InternalError("Unsupported exchange type : " + + std::to_string((int)_part_type)); + } + _profile->add_info_string("PartitionType", get_partition_type_name(_part_type)); Review Comment: 直接使用thrift的定义就能to string -- 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