Skip to content

Commit be942d3

Browse files
authored
chore: adjust row count assertion in table compaction (#15380)
fix: adjust row count assertion in table compaction Correct the assertion to check that the row count remains unchanged during table compaction, instead of comparing it(new snapshot) to the pre-compaction snapshot. This change accounts for scenarios where the new snapshot results from a combination of compaction and insertion, potentially increasing the total number of rows.
1 parent fc815ca commit be942d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/query/storages/fuse/src/operations/common/generators/mutation_generator.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ impl SnapshotGenerator for MutationGenerator {
110110

111111
if matches!(self.mutation_kind, MutationKind::Compact) {
112112
// for compaction, a basic but very important verification:
113-
// the number of rows should not be changed
113+
// the number of rows should be the same
114114
assert_eq!(
115-
new_snapshot.summary.row_count,
116-
self.base_snapshot.summary.row_count
115+
ctx.merged_statistics.row_count,
116+
ctx.removed_statistics.row_count
117117
);
118118
}
119119

0 commit comments

Comments
 (0)