diff --git a/Cargo.lock b/Cargo.lock index 220d925fb..c43459042 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3943,6 +3943,7 @@ dependencies = [ "ahash 0.8.6", "anyhow", "assert-json-diff", + "atoi", "bincode", "byteorder", "bytes", diff --git a/Cargo.toml b/Cargo.toml index 3513fe4af..1da4d77aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,6 +69,7 @@ panic = "abort" [dependencies] ahash = "0.8" anyhow = { version = "1.0", optional = true } +atoi = "2" bincode = "1.3" byteorder = "1.5" bytes = "1" diff --git a/src/cmd/stats.rs b/src/cmd/stats.rs index 74880da6a..8cd0703eb 100644 --- a/src/cmd/stats.rs +++ b/src/cmd/stats.rs @@ -1046,6 +1046,8 @@ impl Stats { }; } }, + // do nothing for String type + TString => {}, TFloat | TInteger => { if sample_type == TNull { if self.which.include_nulls { @@ -1069,8 +1071,6 @@ impl Stats { } } }, - // do nothing for String type - TString => {}, TDateTime | TDate => { if sample_type == TNull { if self.which.include_nulls { @@ -1612,7 +1612,7 @@ impl TypedSum { // so we don't panic on overflow/underflow, use saturating_add self.integer = self .integer - .saturating_add(from_bytes::(sample).unwrap()); + .saturating_add(atoi::atoi::(sample).unwrap()); } }, _ => {}, @@ -1685,13 +1685,13 @@ impl TypedMinMax { self.integers.add(n as i64); }, TInteger => { - let n = from_utf8(sample).unwrap().parse::().unwrap(); + let n = atoi::atoi::(sample).unwrap(); self.integers.add(n); #[allow(clippy::cast_precision_loss)] self.floats.add(n as f64); }, TDate | TDateTime => { - let n = from_utf8(sample).unwrap().parse::().unwrap(); + let n = atoi::atoi::(sample).unwrap(); self.dates.add(n); }, }