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

Function basic_array_rewrite

nodedb-sql/src/parser/preprocess/vector_ops.rs:190–200  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

188
189 #[test]
190 fn basic_array_rewrite() {
191 let rewritten = rewrite_arrow_distance(
192 "SELECT title FROM articles ORDER BY embedding <-> ARRAY[0.1, 0.2, 0.3] LIMIT 5",
193 )
194 .unwrap();
195 assert!(
196 rewritten.contains("vector_distance(embedding, ARRAY[0.1, 0.2, 0.3])"),
197 "got: {rewritten}"
198 );
199 assert!(!rewritten.contains("<->"));
200 }
201
202 #[test]
203 fn rewrite_with_param() {

Callers

nothing calls this directly

Calls 1

rewrite_arrow_distanceFunction · 0.85

Tested by

no test coverage detected