()
| 415 | |
| 416 | #[test] |
| 417 | fn all_named_options() { |
| 418 | let plan = plan_ann( |
| 419 | "SELECT id FROM embeddings ORDER BY vector_distance(embedding, [1.0, 0.0], quantization => 'pq', oversample => 5, query_dim => 64, meta_token_budget => 8, ef_search => 200, target_recall => 0.9) LIMIT 5", |
| 420 | ); |
| 421 | let SqlPlan::VectorSearch { ann_options, .. } = plan else { |
| 422 | panic!("expected VectorSearch plan"); |
| 423 | }; |
| 424 | assert_eq!(ann_options.quantization, Some(VectorQuantization::Pq)); |
| 425 | assert_eq!(ann_options.oversample, Some(5)); |
| 426 | assert_eq!(ann_options.query_dim, Some(64)); |
| 427 | assert_eq!(ann_options.meta_token_budget, Some(8)); |
| 428 | assert_eq!(ann_options.ef_search_override, Some(200)); |
| 429 | assert!((ann_options.target_recall.unwrap() - 0.9_f32).abs() < 0.001); |
| 430 | } |
| 431 | |
| 432 | #[test] |
| 433 | fn json_string_form_rejected() { |
nothing calls this directly
no test coverage detected