koarz commented on code in PR #58756:
URL: https://github.com/apache/doris/pull/58756#discussion_r2596914141


##########
be/src/olap/merger.cpp:
##########
@@ -487,15 +495,31 @@ Status Merger::vertical_merge_rowsets(BaseTabletSPtr 
tablet, ReaderType reader_t
                                      ? config::compaction_batch_size
                                      : estimate_batch_size(i, tablet, 
merge_way_num);
         CompactionSampleInfo sample_info;
+        Merger::Statistics group_stats;
+        group_stats.rowid_conversion = total_stats.rowid_conversion;
+        Merger::Statistics* group_stats_ptr = stats_output != nullptr ? 
&group_stats : nullptr;
         Status st = vertical_compact_one_group(
                 tablet, reader_type, tablet_schema, is_key, column_groups[i], 
&row_sources_buf,
-                src_rowset_readers, dst_rowset_writer, max_rows_per_segment, 
stats_output,
+                src_rowset_readers, dst_rowset_writer, max_rows_per_segment, 
group_stats_ptr,
                 key_group_cluster_key_idxes, batch_size, &sample_info);
         {
             std::unique_lock<std::mutex> lock(tablet->sample_info_lock);
             tablet->sample_infos[i] = sample_info;
         }
         RETURN_IF_ERROR(st);
+        if (stats_output != nullptr) {
+            total_stats.bytes_read_from_local += 
group_stats.bytes_read_from_local;
+            total_stats.bytes_read_from_remote += 
group_stats.bytes_read_from_remote;
+            total_stats.cached_bytes_total += group_stats.cached_bytes_total;
+            total_stats.cloud_local_read_time += 
group_stats.cloud_local_read_time;
+            total_stats.cloud_remote_read_time += 
group_stats.cloud_remote_read_time;
+            if (is_key) {
+                total_stats.output_rows = group_stats.output_rows;

Review Comment:
   Why are all the variables here assigned directly instead of using `+=`?



-- 
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]

Reply via email to