From dc1caa7f255c73802b87c4858837470f68c7b034 Mon Sep 17 00:00:00 2001 From: Nick Mills-Barrett Date: Thu, 2 Jun 2022 18:07:55 +0100 Subject: [PATCH] Fix save ratio check Currently the compressor will rewrite state even if the result consists of the same number of rows which doesn't match the log statement. --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index af2a8db..24ac04d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -369,7 +369,7 @@ pub fn run(mut config: Config) { graphing::make_graphs(&state_group_map, new_state_group_map); } - if ratio > 1.0 { + if ratio >= 1.0 { warn!("This compression would not remove any rows. Exiting."); return; } @@ -578,7 +578,7 @@ pub fn continue_run( let ratio = (new_num_rows as f64) / (original_num_rows as f64); - if ratio > 1.0 { + if ratio >= 1.0 { warn!("This compression would not remove any rows. Aborting."); return Some(ChunkStats { new_level_info: compressor.get_level_info(),