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

Function extract_f64_val

nodedb-query/src/msgpack_scan/aggregate.rs:251–257  ·  view source on GitHub ↗
(doc: &[u8], field: &str, expr: Option<&crate::expr::SqlExpr>)

Source from the content-addressed store, hash-verified

249/// Extract a numeric value from a field or expression result.
250#[inline]
251fn extract_f64_val(doc: &[u8], field: &str, expr: Option<&crate::expr::SqlExpr>) -> Option<f64> {
252 if let Some(expr) = expr {
253 return value_ops::value_to_f64(&eval_expr_on_doc(doc, expr)?, false);
254 }
255 let (start, _end) = extract_field(doc, 0, field)?;
256 read_f64(doc, start)
257}
258
259/// Extract a string from a field or expression result.
260fn extract_str_val(doc: &[u8], field: &str, expr: Option<&crate::expr::SqlExpr>) -> Option<String> {

Callers 2

compute_aggregate_binaryFunction · 0.85
stat_aggregateFunction · 0.85

Calls 4

value_to_f64Function · 0.85
eval_expr_on_docFunction · 0.85
extract_fieldFunction · 0.85
read_f64Function · 0.70

Tested by

no test coverage detected