Kurtiscwright commented on code in PR #2589:
URL: https://github.com/apache/iceberg-rust/pull/2589#discussion_r3376571349
##########
crates/iceberg/src/spec/snapshot_summary.rs:
##########
@@ -142,8 +141,52 @@ impl SnapshotSummaryCollector {
}
/// Builds final map of summaries
- pub fn build(&self) -> HashMap<String, String> {
+ pub fn build(&self, prev_summary: Option<&Summary>) -> HashMap<String,
String> {
let mut properties = self.metrics.to_map();
+
+ update_total(
+ prev_summary,
+ &mut properties,
+ self.metrics.added_data_files as u64,
+ self.metrics.removed_data_files as u64,
+ TOTAL_DATA_FILES,
+ );
+ update_total(
+ prev_summary,
+ &mut properties,
+ self.metrics.added_delete_files as u64,
+ self.metrics.removed_delete_files as u64,
+ TOTAL_DELETE_FILES,
+ );
+ update_total(
+ prev_summary,
+ &mut properties,
+ self.metrics.added_records,
+ self.metrics.deleted_records,
+ TOTAL_RECORDS,
+ );
+ update_total(
+ prev_summary,
+ &mut properties,
+ self.metrics.added_file_size,
+ self.metrics.removed_file_size,
+ TOTAL_FILE_SIZE,
+ );
+ update_total(
+ prev_summary,
+ &mut properties,
+ self.metrics.added_pos_deletes,
+ self.metrics.removed_pos_deletes,
+ TOTAL_POSITION_DELETES,
+ );
+ update_total(
+ prev_summary,
+ &mut properties,
+ self.metrics.added_eq_deletes,
+ self.metrics.removed_eq_deletes,
+ TOTAL_EQUALITY_DELETES,
+ );
Review Comment:
This is more of a nitpick. I am approving, but I would like to see a
refactor of the summary construction eventually if not in this PR.
--
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]