dataroaring commented on code in PR #42565: URL: https://github.com/apache/doris/pull/42565#discussion_r1829298709
########## be/src/olap/rowset/vertical_beta_rowset_writer.cpp: ########## @@ -71,7 +72,10 @@ Status VerticalBetaRowsetWriter<T>::add_columns(const vectorized::Block* block, _cur_writer_idx = 0; RETURN_IF_ERROR(_segment_writers[_cur_writer_idx]->append_block(block, 0, num_rows)); } else if (is_key) { - if (_segment_writers[_cur_writer_idx]->num_rows_written() > max_rows_per_segment) { + // TODO for cluster key, always create new segment writer because the primary keys are + // sorted in SegmentWriter::_generate_primary_key_index, will cause too many segments + if (_segment_writers[_cur_writer_idx]->num_rows_written() > max_rows_per_segment || + has_cluster_key) { Review Comment: It may generate a lot small files. Maybe we should use external sort to handle _generate_primary_key_index. -- 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