From 23ab79cd112eda28657642386ab5823c7f01e366 Mon Sep 17 00:00:00 2001 From: Milind Srivastava Date: Thu, 16 Apr 2026 18:36:35 -0400 Subject: [PATCH 1/2] fix: updates based on changes in asap_sketchlib's API --- Cargo.lock | 167 ++---------------- .../sketch-core/src/count_min_sketchlib.rs | 6 +- .../src/count_min_with_heap_sketchlib.rs | 8 +- asap-common/sketch-core/src/kll_sketchlib.rs | 4 +- .../src/stores/promsketch_store/query.rs | 10 +- .../src/stores/promsketch_store/series.rs | 4 +- .../templates/udfs/countminsketch_count.rs.j2 | 4 +- .../templates/udfs/countminsketch_sum.rs.j2 | 4 +- .../udfs/countminsketchwithheap_topk.rs.j2 | 4 +- .../templates/udfs/datasketcheskll_.rs.j2 | 4 +- .../templates/udfs/hydrakll_.rs.j2 | 4 +- 11 files changed, 45 insertions(+), 174 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 91c4a2bd..dc030cd4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -403,16 +403,12 @@ dependencies = [ [[package]] name = "asap_sketchlib" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/asap_sketchlib#2442d95ef8bc8470f9909728fadc72b5e082139d" +source = "git+https://github.com/ProjectASAP/asap_sketchlib#19035220b7d999d1e12ca927574557fb702c2741" dependencies = [ "bytes", - "clap 4.6.0", - "core_affinity", - "crossbeam-channel", - "pcap", "prost", "prost-build", - "rand 0.9.2", + "rand 0.9.4", "rmp-serde", "serde", "serde-big-array", @@ -961,17 +957,6 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" -[[package]] -name = "core_affinity" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a034b3a7b624016c6e13f5df875747cc25f884156aad2abd12b6c46797971342" -dependencies = [ - "libc", - "num_cpus", - "winapi", -] - [[package]] name = "cpufeatures" version = "0.2.17" @@ -1524,7 +1509,7 @@ dependencies = [ "itertools 0.13.0", "log", "paste", - "petgraph 0.6.5", + "petgraph", ] [[package]] @@ -1704,17 +1689,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" -[[package]] -name = "errno" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] - [[package]] name = "errno" version = "0.3.14" @@ -1722,17 +1696,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", + "windows-sys 0.52.0", ] [[package]] @@ -1776,12 +1740,6 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" -[[package]] -name = "fixedbitset" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" - [[package]] name = "flatbuffers" version = "24.12.23" @@ -2480,7 +2438,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi 0.5.2", "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -2507,15 +2465,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.18" @@ -2534,7 +2483,7 @@ dependencies = [ "portable-atomic", "portable-atomic-util", "serde_core", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -2660,16 +2609,6 @@ version = "0.2.184" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af" -[[package]] -name = "libloading" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" -dependencies = [ - "cfg-if", - "winapi", -] - [[package]] name = "libm" version = "0.2.16" @@ -2908,7 +2847,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -3267,21 +3206,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "pcap" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e935fc73d54a89fff576526c2ccd42bbf8247aae05b358693475b14fd4ff79" -dependencies = [ - "bitflags 1.3.2", - "errno 0.2.8", - "libc", - "libloading", - "pkg-config", - "regex", - "windows-sys 0.36.1", -] - [[package]] name = "percent-encoding" version = "2.3.2" @@ -3294,17 +3218,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ - "fixedbitset 0.4.2", - "indexmap 2.13.1", -] - -[[package]] -name = "petgraph" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" -dependencies = [ - "fixedbitset 0.5.7", + "fixedbitset", "indexmap 2.13.1", ] @@ -3566,11 +3480,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" dependencies = [ "heck 0.5.0", - "itertools 0.14.0", + "itertools 0.10.5", "log", "multimap", "once_cell", - "petgraph 0.7.1", + "petgraph", "prettyplease", "prost", "prost-types", @@ -3586,7 +3500,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" dependencies = [ "anyhow", - "itertools 0.14.0", + "itertools 0.10.5", "proc-macro2", "quote", "syn 2.0.117", @@ -3710,9 +3624,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.5", @@ -3968,10 +3882,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ "bitflags 2.11.0", - "errno 0.3.14", + "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -4180,7 +4094,7 @@ version = "1.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" dependencies = [ - "errno 0.3.14", + "errno", "libc", ] @@ -4486,7 +4400,7 @@ dependencies = [ "getrandom 0.4.2", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -4912,7 +4826,7 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea3136b675547379c4bd395ca6b938e5ad3c3d20fad76e7fe85f9e0d011419c" dependencies = [ - "rand 0.9.2", + "rand 0.9.4", ] [[package]] @@ -5207,7 +5121,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.48.0", ] [[package]] @@ -5275,19 +5189,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" -dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -5367,12 +5268,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -5385,12 +5280,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -5409,12 +5298,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -5427,12 +5310,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -5457,12 +5334,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" diff --git a/asap-common/sketch-core/src/count_min_sketchlib.rs b/asap-common/sketch-core/src/count_min_sketchlib.rs index 6fb3924d..69505801 100644 --- a/asap-common/sketch-core/src/count_min_sketchlib.rs +++ b/asap-common/sketch-core/src/count_min_sketchlib.rs @@ -1,4 +1,4 @@ -use asap_sketchlib::{CountMin, RegularPath, SketchInput, Vector2D}; +use asap_sketchlib::{CountMin, DataInput, RegularPath, Vector2D}; /// Concrete Count-Min type from asap_sketchlib when sketchlib backend is enabled. /// Uses f64 counters (Vector2D) for weighted updates without integer rounding. @@ -48,12 +48,12 @@ pub fn sketchlib_cms_update(inner: &mut SketchlibCms, key: &str, value: f64) { if value <= 0.0 { return; } - let input = SketchInput::String(key.to_owned()); + let input = DataInput::String(key.to_owned()); inner.insert_many(&input, value); } /// Helper to query a sketchlib Count-Min for a key, returning f64. pub fn sketchlib_cms_query(inner: &SketchlibCms, key: &str) -> f64 { - let input = SketchInput::String(key.to_owned()); + let input = DataInput::String(key.to_owned()); inner.estimate(&input) } diff --git a/asap-common/sketch-core/src/count_min_with_heap_sketchlib.rs b/asap-common/sketch-core/src/count_min_with_heap_sketchlib.rs index 451c5b87..78c1415a 100644 --- a/asap-common/sketch-core/src/count_min_with_heap_sketchlib.rs +++ b/asap-common/sketch-core/src/count_min_with_heap_sketchlib.rs @@ -4,7 +4,7 @@ //! providing automatic top-k tracking during insert and merge. use asap_sketchlib::RegularPath; -use asap_sketchlib::{CMSHeap, SketchInput, Vector2D}; +use asap_sketchlib::{CMSHeap, DataInput, Vector2D}; /// Wire-format heap item (key, value) to avoid circular dependency with count_min_with_heap. pub struct WireHeapItem { @@ -47,7 +47,7 @@ pub fn sketchlib_cms_heap_from_matrix_and_heap( for item in topk_heap { let count = item.value.round() as i64; if count > 0 { - let input = SketchInput::Str(&item.key); + let input = DataInput::Str(&item.key); cms_heap.heap_mut().update(&input, count); } } @@ -98,12 +98,12 @@ pub fn sketchlib_cms_heap_update(cms_heap: &mut SketchlibCMSHeap, key: &str, val if many <= 0 { return; } - let input = SketchInput::String(key.to_owned()); + let input = DataInput::String(key.to_owned()); cms_heap.insert_many(&input, many); } /// Queries a CMSHeap for a key's frequency estimate. pub fn sketchlib_cms_heap_query(cms_heap: &SketchlibCMSHeap, key: &str) -> f64 { - let input = SketchInput::String(key.to_owned()); + let input = DataInput::String(key.to_owned()); cms_heap.estimate(&input) as f64 } diff --git a/asap-common/sketch-core/src/kll_sketchlib.rs b/asap-common/sketch-core/src/kll_sketchlib.rs index d49d80b9..bdbee0e5 100644 --- a/asap-common/sketch-core/src/kll_sketchlib.rs +++ b/asap-common/sketch-core/src/kll_sketchlib.rs @@ -1,4 +1,4 @@ -use asap_sketchlib::{SketchInput, KLL}; +use asap_sketchlib::KLL; /// Concrete KLL type from asap_sketchlib when sketchlib backend is enabled. pub type SketchlibKll = KLL; @@ -12,7 +12,7 @@ pub fn new_sketchlib_kll(k: u16) -> SketchlibKll { pub fn sketchlib_kll_update(inner: &mut SketchlibKll, value: f64) { // KLL accepts only numeric inputs. We intentionally ignore the error here because `value` // is always numeric. - let _ = inner.update(&SketchInput::F64(value)); + inner.update(&value); } /// Queries a sketchlib KLL for the value at the requested quantile. diff --git a/asap-query-engine/src/stores/promsketch_store/query.rs b/asap-query-engine/src/stores/promsketch_store/query.rs index 0de029bb..2090c76f 100644 --- a/asap-query-engine/src/stores/promsketch_store/query.rs +++ b/asap-query-engine/src/stores/promsketch_store/query.rs @@ -1,4 +1,4 @@ -use asap_sketchlib::{EHSketchList, SketchInput, UniformSampling}; +use asap_sketchlib::{DataInput, EHSketchList, UniformSampling}; use super::series::PromSketchMemSeries; @@ -80,7 +80,7 @@ fn eval_kll_quantile( .ok_or("no volumes cover the requested time range for KLL")?; merged - .query(&SketchInput::F64(phi)) + .query(&DataInput::F64(phi)) .map_err(|e| -> Box { e.into() }) } @@ -174,7 +174,7 @@ mod tests { // Insert values 1..=100 at successive timestamps for i in 1..=100u64 { - let input = SketchInput::F64(i as f64); + let input = DataInput::F64(i as f64); if let Some(ref mut eh) = series.sketch_instances.eh_kll { eh.update(i, &input); } @@ -190,7 +190,7 @@ mod tests { .ensure_initialized(PromSketchType::USampling, &config); for i in 1..=1000u64 { - let input = SketchInput::F64(i as f64); + let input = DataInput::F64(i as f64); if let Some(ref mut eh) = series.sketch_instances.eh_sampling { eh.update(i, &input); } @@ -206,7 +206,7 @@ mod tests { .ensure_initialized(PromSketchType::EHUniv, &config); for i in 1..=100u64 { - let input = SketchInput::F64(i as f64); + let input = DataInput::F64(i as f64); if let Some(ref mut eh) = series.sketch_instances.eh_univ { eh.update(i, &input, 1); } diff --git a/asap-query-engine/src/stores/promsketch_store/series.rs b/asap-query-engine/src/stores/promsketch_store/series.rs index cdffe49f..87710a73 100644 --- a/asap-query-engine/src/stores/promsketch_store/series.rs +++ b/asap-query-engine/src/stores/promsketch_store/series.rs @@ -1,5 +1,5 @@ use asap_sketchlib::{ - EHSketchList, EHUnivOptimized, ExponentialHistogram, SketchInput, UniformSampling, KLL, + DataInput, EHSketchList, EHUnivOptimized, ExponentialHistogram, UniformSampling, KLL, }; use super::config::PromSketchConfig; @@ -68,7 +68,7 @@ impl PromSketchInstances { /// Insert a data point into all active sketches. pub fn insert(&mut self, time: u64, value: f64) { - let input = SketchInput::F64(value); + let input = DataInput::F64(value); if let Some(ref mut eh) = self.eh_univ { // EHUnivOptimized::update(time, key, frequency_count) diff --git a/asap-summary-ingest/templates/udfs/countminsketch_count.rs.j2 b/asap-summary-ingest/templates/udfs/countminsketch_count.rs.j2 index b8c3d54d..f49acd1a 100644 --- a/asap-summary-ingest/templates/udfs/countminsketch_count.rs.j2 +++ b/asap-summary-ingest/templates/udfs/countminsketch_count.rs.j2 @@ -11,7 +11,7 @@ use rmp_serde::Serializer; use serde::{Deserialize, Serialize}; use twox_hash::XxHash32; -use asap_sketchlib::{CountMin as SketchlibCountMin, RegularPath, SketchInput, Vector2D}; +use asap_sketchlib::{CountMin as SketchlibCountMin, RegularPath, DataInput, Vector2D}; // Count-Min Sketch parameters const DEPTH: usize = {{ depth }}; // Number of hash functions @@ -66,7 +66,7 @@ fn countminsketch_count(keys: Vec<&str>, values: Vec) -> Option> { let mut inner = SketchlibCms::with_dimensions(DEPTH, WIDTH); for &key in keys.iter() { - let input = SketchInput::String(key.to_owned()); + let input = DataInput::String(key.to_owned()); inner.insert_many(&input, 1); } diff --git a/asap-summary-ingest/templates/udfs/countminsketch_sum.rs.j2 b/asap-summary-ingest/templates/udfs/countminsketch_sum.rs.j2 index 563ea2a9..3ce62c57 100644 --- a/asap-summary-ingest/templates/udfs/countminsketch_sum.rs.j2 +++ b/asap-summary-ingest/templates/udfs/countminsketch_sum.rs.j2 @@ -11,7 +11,7 @@ use rmp_serde::Serializer; use serde::{Deserialize, Serialize}; use twox_hash::XxHash32; -use asap_sketchlib::{CountMin as SketchlibCountMin, RegularPath, SketchInput, Vector2D}; +use asap_sketchlib::{CountMin as SketchlibCountMin, RegularPath, DataInput, Vector2D}; // Count-Min Sketch parameters const DEPTH: usize = {{ depth }}; // Number of hash functions @@ -77,7 +77,7 @@ fn countminsketch_sum(keys: Vec<&str>, values: Vec) -> Option> { if many <= 0 { continue; } - let input = SketchInput::String(key.to_owned()); + let input = DataInput::String(key.to_owned()); inner.insert_many(&input, many); } diff --git a/asap-summary-ingest/templates/udfs/countminsketchwithheap_topk.rs.j2 b/asap-summary-ingest/templates/udfs/countminsketchwithheap_topk.rs.j2 index 0fd3fc5d..1518fe0f 100644 --- a/asap-summary-ingest/templates/udfs/countminsketchwithheap_topk.rs.j2 +++ b/asap-summary-ingest/templates/udfs/countminsketchwithheap_topk.rs.j2 @@ -14,7 +14,7 @@ use rmp_serde::Serializer; use serde::{Deserialize, Serialize}; use twox_hash::XxHash32; -use asap_sketchlib::{CountMin as SketchlibCountMin, RegularPath, SketchInput, Vector2D}; +use asap_sketchlib::{CountMin as SketchlibCountMin, RegularPath, DataInput, Vector2D}; // Count-Min Sketch with Heap parameters const DEPTH: usize = {{ depth }}; // Number of hash functions @@ -158,7 +158,7 @@ impl CountMinSketchWithHeap { if many <= 0 { return; } - let input = SketchInput::String(key.to_owned()); + let input = DataInput::String(key.to_owned()); inner.insert_many(&input, many); inner.estimate(&input) as f64 } else { diff --git a/asap-summary-ingest/templates/udfs/datasketcheskll_.rs.j2 b/asap-summary-ingest/templates/udfs/datasketcheskll_.rs.j2 index 593c59d6..40f1933a 100644 --- a/asap-summary-ingest/templates/udfs/datasketcheskll_.rs.j2 +++ b/asap-summary-ingest/templates/udfs/datasketcheskll_.rs.j2 @@ -8,7 +8,7 @@ serde = { version = "1.0", features = ["derive"] } use arroyo_udf_plugin::udf; use serde::{Deserialize, Serialize}; -use asap_sketchlib::{KLL, SketchInput}; +use asap_sketchlib::KLL; const DEFAULT_K: u16 = {{ k }}; @@ -22,7 +22,7 @@ struct KllSketchData { fn datasketcheskll_(values: Vec) -> Option> { let mut sketch = KLL::init_kll(DEFAULT_K as i32); for &value in &values { - let _ = sketch.update(&SketchInput::F64(value)); + sketch.update(&value); } let sketch_bytes = sketch.serialize_to_bytes().ok()?; let serialized = KllSketchData { diff --git a/asap-summary-ingest/templates/udfs/hydrakll_.rs.j2 b/asap-summary-ingest/templates/udfs/hydrakll_.rs.j2 index 198a8827..0888804c 100644 --- a/asap-summary-ingest/templates/udfs/hydrakll_.rs.j2 +++ b/asap-summary-ingest/templates/udfs/hydrakll_.rs.j2 @@ -10,7 +10,7 @@ xxhash-rust = { version = "0.8", features = ["xxh32"] } use arroyo_udf_plugin::udf; use rmp_serde::Serializer; use serde::{Deserialize, Serialize}; -use asap_sketchlib::{KLL, SketchInput}; +use asap_sketchlib::KLL; use xxhash_rust::xxh32::xxh32; const ROW_NUM: usize = {{ row_num }}; @@ -48,7 +48,7 @@ fn hydrakll_(keys: Vec<&str>, values: Vec) -> Option> { for row in 0..ROW_NUM { let hash_value = xxh32(key_bytes, row as u32); let col_index = (hash_value as usize) % COL_NUM; - let _ = sketches[row][col_index].update(&SketchInput::F64(values[i])); + sketches[row][col_index].update(&values[i]); } } From e57d1cf3aa030af2a90b305eec57a9a3e526ef13 Mon Sep 17 00:00:00 2001 From: Milind Srivastava Date: Thu, 16 Apr 2026 18:46:09 -0400 Subject: [PATCH 2/2] fix --- asap-planner-rs/src/query_log/frequency.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asap-planner-rs/src/query_log/frequency.rs b/asap-planner-rs/src/query_log/frequency.rs index 90877a82..975f7520 100644 --- a/asap-planner-rs/src/query_log/frequency.rs +++ b/asap-planner-rs/src/query_log/frequency.rs @@ -64,7 +64,7 @@ pub fn infer_queries( for (_query_str, mut variants) in by_query { // Sort descending by count so [0] is the most frequent variant. - variants.sort_by(|a, b| b.1.len().cmp(&a.1.len())); + variants.sort_by_key(|b| std::cmp::Reverse(b.1.len())); if variants.len() > 1 { tracing::warn!(