morningman commented on code in PR #26611: URL: https://github.com/apache/doris/pull/26611#discussion_r1390434056
########## be/src/vec/sink/vtablet_finder.cpp: ########## @@ -95,8 +95,22 @@ Status OlapTabletFinder::find_tablets(RuntimeState* state, Block* block, int row if (_find_tablet_mode == FindTabletMode::FIND_TABLET_EVERY_ROW) { _vpartition->find_tablets(block, qualified_rows, partitions, tablet_index); } else { + // for random distribution Review Comment: I think the following code can be removed? https://github.com/apache/doris/blob/4230b8c36cac9636199eebb7c0adf82ee176b46e/be/src/exec/tablet_info.h#L211-L221 ########## be/src/vec/sink/vrow_distribution.cpp: ########## @@ -269,7 +269,6 @@ Status VRowDistribution::generate_rows_distribution( RETURN_IF_ERROR(_block_convertor->validate_and_convert_block( _state, &input_block, block, *_vec_output_expr_ctxs, input_rows, has_filtered_rows)); - _tablet_finder->clear_for_new_batch(); Review Comment: Why remove this? ########## be/src/vec/sink/vtablet_finder.cpp: ########## @@ -95,8 +95,22 @@ Status OlapTabletFinder::find_tablets(RuntimeState* state, Block* block, int row if (_find_tablet_mode == FindTabletMode::FIND_TABLET_EVERY_ROW) { _vpartition->find_tablets(block, qualified_rows, partitions, tablet_index); } else { + // for random distribution _vpartition->find_tablets(block, qualified_rows, partitions, tablet_index, &_partition_to_tablet_map); + if (_find_tablet_mode == FindTabletMode::FIND_TABLET_EVERY_BATCH) { Review Comment: `FIND_TABLET_EVERY_BATCH` can save time because it only find tablets once for each batch. But after you change, it still iterate each row in batch to update the partition's `load_tablet_idx`, may it impact the performance? -- 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