diff --git a/Cargo.toml b/Cargo.toml index f5edbac90..fb3e708ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,7 +65,7 @@ tantivy-bitpacker = { version = "0.10", path = "./bitpacker" } common = { version = "0.11", path = "./common/", package = "tantivy-common" } tokenizer-api = { version = "0.7", path = "./tokenizer-api", package = "tantivy-tokenizer-api" } sketches-ddsketch = { version = "0.4", features = ["use_serde"] } -datasketches = { git = "https://github.com/fulmicoton-dd/datasketches-rust", rev = "7635fb8" } +datasketches = { version = "0.3.0", features = ["hll"] } futures-util = { version = "0.3.28", optional = true } futures-channel = { version = "0.3.28", optional = true } fnv = "1.0.7" diff --git a/src/aggregation/metric/cardinality.rs b/src/aggregation/metric/cardinality.rs index 7378d2490..c60ee5f48 100644 --- a/src/aggregation/metric/cardinality.rs +++ b/src/aggregation/metric/cardinality.rs @@ -166,7 +166,11 @@ impl CouponCache { let should_use_dense = highest_term_ord < 1_000_000u64 || highest_term_ord < num_terms as u64 * 3u64; if should_use_dense { - let mut coupon_map: Vec = vec![Coupon::EMPTY; highest_term_ord as usize + 1]; + // We don't really care about the value here. We will populate all the values we will + // read anyway. + let uninitialized_coupon = Coupon::from_hash(0); + let mut coupon_map: Vec = + vec![uninitialized_coupon; highest_term_ord as usize + 1]; for (term_ord, coupon) in term_ords.into_iter().zip(coupons.into_iter()) { coupon_map[term_ord as usize] = coupon; }