MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / order_keys_equal_v

Function order_keys_equal_v

nodedb-query/src/window/value_eval.rs:143–157  ·  view source on GitHub ↗
(
    rows: &[Vec<Value>],
    a: usize,
    b: usize,
    column_index: &HashMap<String, usize>,
    order_by: &[(SqlExpr, bool)],
)

Source from the content-addressed store, hash-verified

141}
142
143pub(super) fn order_keys_equal_v(
144 rows: &[Vec<Value>],
145 a: usize,
146 b: usize,
147 column_index: &HashMap<String, usize>,
148 order_by: &[(SqlExpr, bool)],
149) -> bool {
150 order_by.iter().all(|(expr, _)| {
151 let row_a = rows.get(a).map(|r| r.as_slice()).unwrap_or(&[]);
152 let row_b = rows.get(b).map(|r| r.as_slice()).unwrap_or(&[]);
153 let va = eval_arg_for_row(expr, row_a, column_index);
154 let vb = eval_arg_for_row(expr, row_b, column_index);
155 matches!(cmp_values(&va, &vb), std::cmp::Ordering::Equal)
156 })
157}
158
159// ── Argument evaluation (pub(super) for value_agg) ────────────────────────────
160

Callers 5

apply_v_rankFunction · 0.85
apply_v_dense_rankFunction · 0.85
apply_v_percent_rankFunction · 0.85
apply_v_cume_distFunction · 0.85

Calls 5

eval_arg_for_rowFunction · 0.85
allMethod · 0.45
iterMethod · 0.45
getMethod · 0.45
as_sliceMethod · 0.45

Tested by

no test coverage detected