mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-20 06:50:37 +00:00
feat: impl vector index query (#7564)
* feat: impl vector index query Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * feat: remove VectorSearchRule and merge it into scan hint rule Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * refactor: vector search hint Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * test: join and subquery Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * fix: clippy when feature disabled Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * fix: push hint only when column is non-nullable or an explicit IS NOT NULL filter exists Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * fix: transformed = true Co-authored-by: Yingwen <realevenyag@gmail.com> Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * chore: remove adpater vector hint Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * chore: revert transformed Signed-off-by: Dennis Zhuang <killme2008@gmail.com> --------- Signed-off-by: Dennis Zhuang <killme2008@gmail.com> Co-authored-by: Yingwen <realevenyag@gmail.com>
This commit is contained in:
@@ -26,7 +26,7 @@ use datafusion_expr::TableProviderFilterPushDown as DfTableProviderFilterPushDow
|
||||
use datafusion_expr::expr::Expr;
|
||||
use datafusion_physical_expr::PhysicalSortExpr;
|
||||
use datafusion_physical_expr::expressions::Column;
|
||||
use store_api::storage::ScanRequest;
|
||||
use store_api::storage::{ScanRequest, VectorSearchRequest};
|
||||
|
||||
use crate::table::{TableRef, TableType};
|
||||
|
||||
@@ -52,6 +52,14 @@ impl DfTableProviderAdapter {
|
||||
self.scan_req.lock().unwrap().output_ordering = Some(order_opts.to_vec());
|
||||
}
|
||||
|
||||
pub fn with_vector_search_hint(&self, hint: VectorSearchRequest) {
|
||||
self.scan_req.lock().unwrap().vector_search = Some(hint);
|
||||
}
|
||||
|
||||
pub fn get_vector_search_hint(&self) -> Option<VectorSearchRequest> {
|
||||
self.scan_req.lock().unwrap().vector_search.clone()
|
||||
}
|
||||
|
||||
#[cfg(feature = "testing")]
|
||||
pub fn get_scan_req(&self) -> ScanRequest {
|
||||
self.scan_req.lock().unwrap().clone()
|
||||
|
||||
Reference in New Issue
Block a user