Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 20 additions & 66 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ resolver = "2"
arrow = { version = "58.4", default-features = false }
# The hasher Arrow already uses, for the executor's hot interning maps.
ahash = { version = "0.8", default-features = false, features = ["std", "runtime-rng"] }
asap_sketchlib = { git = "https://github.com/ProjectASAP/asap_sketchlib", rev = "3f44cf1c2d823b844c17796f24408e03863149ee" }
asap_sketchlib = { git = "https://github.com/ProjectASAP/asap_sketchlib", rev = "eb04e7f243c1d5e5c346cd19842f2402d796b620" }
13 changes: 7 additions & 6 deletions crates/executor/src/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
//!
//! Stored-state encodings belong to deployments. Full plan acceptance is
//! owned by `binding`, which also validates schemas, expressions and inputs.
use crate::summary_kernels::hll_sketch::HLL_PRECISIONS;
use crate::summary_kernels::weighted_frequency::{self, FrequencyAlgorithm};
use crate::Error;
use planner_types::ir::schema::{
ExactKind, ExactParams, FieldDataType as SummaryFamilyType, GroupingStrategy, SketchAlgorithm,
Expand Down Expand Up @@ -59,14 +61,14 @@ pub fn validate_summary_kernel(
{
false
}
(A::Hll, P::Hll { precision, .. }) if (4..=18).contains(precision) => false,
(A::Hll, P::Hll { precision, .. }) if HLL_PRECISIONS.contains(precision) => false,
(A::Kmv, P::Kmv { k, .. }) if *k >= crate::summary_kernels::kmv::KMV_MIN_K => false,
(A::Cms, P::Cms { width, depth }) if valid_matrix(*width, *depth) => true,
// The kernel's shape rules (an odd depth, for the median).
(A::CountSketch, P::CountSketch { width, depth })
if valid_matrix(*width, *depth)
&& asap_sketchlib::WeightedFrequency::check_shape(
asap_sketchlib::FrequencyAlgorithm::CountSketch,
&& weighted_frequency::check_shape(
FrequencyAlgorithm::CountSketch,
*width as usize,
*depth as usize,
)
Expand Down Expand Up @@ -99,7 +101,7 @@ pub fn validate_summary_kernel(
layers,
..
},
) if asap_sketchlib::UnivMon::check_shape(
) if crate::summary_kernels::univmon::check_shape(
*heap_size as usize,
*sketch_rows as usize,
*sketch_cols as usize,
Expand Down Expand Up @@ -306,8 +308,7 @@ pub fn validate_native_family(family: &SummaryFamilyType) -> Result<(), Error> {
};
}
if matches!(kind.algorithm(), A::CmsWithHeap | A::CountSketchWithHeap) {
let (_, width, depth, _) =
crate::summary_kernels::weighted_frequency::WeightedFrequency::configuration(kind)?;
let (_, width, depth, _) = weighted_frequency::WeightedFrequency::configuration(kind)?;
return if valid_matrix(width as u32, depth as u32) && grouping == &Default::default() {
Ok(())
} else {
Expand Down
6 changes: 5 additions & 1 deletion crates/executor/src/operators/row_reference/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ pub(crate) mod harness {
);
}
if let Some(frequency) = any.downcast_ref::<WeightedFrequency>() {
return serde_json::to_string(frequency).unwrap();
return format!(
"{:?} {:?}",
frequency.counters(),
frequency.rows(usize::MAX)
);
}
panic!("no fingerprint for this state kind")
}
Expand Down
Loading
Loading