pub struct DataFusionQueryExecutor;Expand description
DataFusion-powered query executor for repository operations.
This executor converts repository data into Apache Arrow columnar format and leverages DataFusion’s query optimizer for efficient filtering, sorting, and aggregation operations.
§Performance Benefits
- Vectorized operations: SIMD optimizations for filtering and sorting
- Pushdown predicates: Filters applied at the storage layer
- Memory efficiency: Columnar format reduces memory overhead
- Query optimization: Cost-based optimization for complex queries
§Example
ⓘ
use term_guard::repository::datafusion_executor::DataFusionQueryExecutor;
let results = DataFusionQueryExecutor::execute_optimized_query(
repository_data,
before,
after,
tag_filters,
analyzer_filters,
limit,
offset,
ascending
).await?;Implementations§
Source§impl DataFusionQueryExecutor
impl DataFusionQueryExecutor
Sourcepub async fn execute_optimized_query(
data: Vec<(ResultKey, AnalyzerContext)>,
before: Option<i64>,
after: Option<i64>,
tags: &HashMap<String, String>,
analyzers: &Option<Vec<String>>,
limit: Option<usize>,
offset: Option<usize>,
ascending: bool,
) -> Result<Vec<(ResultKey, AnalyzerContext)>>
pub async fn execute_optimized_query( data: Vec<(ResultKey, AnalyzerContext)>, before: Option<i64>, after: Option<i64>, tags: &HashMap<String, String>, analyzers: &Option<Vec<String>>, limit: Option<usize>, offset: Option<usize>, ascending: bool, ) -> Result<Vec<(ResultKey, AnalyzerContext)>>
Executes an optimized query using DataFusion’s query engine.
This method converts repository data into Arrow format, registers it as a table, constructs an SQL query with filters, and executes it using DataFusion’s vectorized query engine.
§Arguments
data- Repository data as (ResultKey, AnalyzerContext) pairsbefore- Optional timestamp filter (exclusive)after- Optional timestamp filter (inclusive)tags- Tag filters to applyanalyzers- Optional analyzer name filterslimit- Maximum number of results to returnoffset- Number of results to skipascending- Sort order (true = ascending, false = descending)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DataFusionQueryExecutor
impl RefUnwindSafe for DataFusionQueryExecutor
impl Send for DataFusionQueryExecutor
impl Sync for DataFusionQueryExecutor
impl Unpin for DataFusionQueryExecutor
impl UnwindSafe for DataFusionQueryExecutor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more