Gabriel39 commented on code in PR #48720:
URL: https://github.com/apache/doris/pull/48720#discussion_r1982767488
##########
be/src/vec/sink/tablet_sink_hash_partitioner.cpp:
##########
@@ -139,17 +138,28 @@ Status TabletSinkHashPartitioner::close(RuntimeState*
state) {
return Status::OK();
}
-Status TabletSinkHashPartitioner::_send_new_partition_batch(RuntimeState*
state,
- vectorized::Block*
input_block,
- bool eos) const {
- RETURN_IF_ERROR(_row_distribution.automatic_create_partition());
- auto& p = _local_state->parent()->cast<pipeline::ExchangeSinkOperatorX>();
- // Recovery back
- _row_distribution.clear_batching_stats();
- _row_distribution._batching_block->clear_column_data();
- _row_distribution._deal_batched = false;
- RETURN_IF_ERROR(p.sink(state, input_block, eos));
+Status TabletSinkHashPartitioner::_send_new_partition_batch(RuntimeState*
state) const {
+ if (_row_distribution.need_deal_batching()) {
+ SCOPED_TIMER(_local_state->send_new_partition_timer());
+ RETURN_IF_ERROR(_row_distribution.automatic_create_partition());
+ auto& p =
_local_state->parent()->cast<pipeline::ExchangeSinkOperatorX>();
+
+ Block tmp_block = _row_distribution._batching_block->to_block(); //
Borrow out, for lval ref
+ _row_distribution.clear_batching_stats();
+ VLOG_DEBUG << "sinking batched block:\n" << tmp_block.dump_data();
+ RETURN_IF_ERROR(p.sink(state, &tmp_block, false));
Review Comment:
Do not call `p.sink` here
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]