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

Function fold_st_geohash

nodedb-sql/src/planner/const_fold.rs:398–417  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

396
397 #[test]
398 fn fold_st_geohash() {
399 let registry = FunctionRegistry::new();
400 let expr = SqlExpr::Function {
401 name: "st_geohash".into(),
402 args: vec![
403 SqlExpr::UnaryOp {
404 op: UnaryOp::Neg,
405 expr: Box::new(SqlExpr::Literal(SqlValue::Float(122.4))),
406 },
407 SqlExpr::Literal(SqlValue::Float(37.8)),
408 SqlExpr::Literal(SqlValue::Int(6)),
409 ],
410 distinct: false,
411 };
412 let v = fold_constant(&expr, &registry);
413 match v {
414 Some(SqlValue::String(ref s)) if !s.is_empty() => {}
415 other => panic!("expected non-empty SqlValue::String, got {other:?}"),
416 }
417 }
418
419 #[test]
420 fn fold_st_distance_nested_st_point() {

Callers

nothing calls this directly

Calls 2

fold_constantFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected