pub struct QueryEngine { /* private fields */ }Expand description
Query engine that executes SQL directly on DataTable
Implementations§
Source§impl QueryEngine
 
impl QueryEngine
pub fn new() -> Self
pub fn with_behavior_config(config: BehaviorConfig) -> Self
pub fn with_date_notation(_date_notation: String) -> Self
pub fn with_case_insensitive(case_insensitive: bool) -> Self
pub fn with_case_insensitive_and_date_notation( case_insensitive: bool, _date_notation: String, ) -> Self
Sourcepub fn execute(&self, table: Arc<DataTable>, sql: &str) -> Result<DataView>
 
pub fn execute(&self, table: Arc<DataTable>, sql: &str) -> Result<DataView>
Execute a SQL query on a DataTable and return a DataView (for backward compatibility)
Sourcepub fn execute_with_temp_tables(
    &self,
    table: Arc<DataTable>,
    sql: &str,
    temp_tables: Option<&TempTableRegistry>,
) -> Result<DataView>
 
pub fn execute_with_temp_tables( &self, table: Arc<DataTable>, sql: &str, temp_tables: Option<&TempTableRegistry>, ) -> Result<DataView>
Execute a SQL query with optional temp table registry access
Sourcepub fn execute_statement(
    &self,
    table: Arc<DataTable>,
    statement: SelectStatement,
) -> Result<DataView>
 
pub fn execute_statement( &self, table: Arc<DataTable>, statement: SelectStatement, ) -> Result<DataView>
Execute a parsed SelectStatement on a DataTable and return a DataView
Sourcepub fn execute_statement_with_temp_tables(
    &self,
    table: Arc<DataTable>,
    statement: SelectStatement,
    temp_tables: Option<&TempTableRegistry>,
) -> Result<DataView>
 
pub fn execute_statement_with_temp_tables( &self, table: Arc<DataTable>, statement: SelectStatement, temp_tables: Option<&TempTableRegistry>, ) -> Result<DataView>
Execute a parsed SelectStatement with optional temp table access
Sourcepub fn execute_statement_with_cte_context(
    &self,
    table: Arc<DataTable>,
    statement: SelectStatement,
    cte_context: &HashMap<String, Arc<DataView>>,
) -> Result<DataView>
 
pub fn execute_statement_with_cte_context( &self, table: Arc<DataTable>, statement: SelectStatement, cte_context: &HashMap<String, Arc<DataView>>, ) -> Result<DataView>
Execute a statement with provided CTE context (for subqueries)
Sourcepub fn execute_with_plan(
    &self,
    table: Arc<DataTable>,
    sql: &str,
) -> Result<(DataView, ExecutionPlan)>
 
pub fn execute_with_plan( &self, table: Arc<DataTable>, sql: &str, ) -> Result<(DataView, ExecutionPlan)>
Execute a query and return both the result and the execution plan
Sourcepub fn execute_with_plan_and_temp_tables(
    &self,
    table: Arc<DataTable>,
    sql: &str,
    temp_tables: Option<&TempTableRegistry>,
) -> Result<(DataView, ExecutionPlan)>
 
pub fn execute_with_plan_and_temp_tables( &self, table: Arc<DataTable>, sql: &str, temp_tables: Option<&TempTableRegistry>, ) -> Result<(DataView, ExecutionPlan)>
Execute a query with temp tables and return both the result and the execution plan
Sourcepub fn materialize_view(&self, view: DataView) -> Result<DataTable>
 
pub fn materialize_view(&self, view: DataView) -> Result<DataTable>
Materialize a DataView into a new DataTable
Sourcepub fn estimate_group_cardinality(
    &self,
    view: &DataView,
    group_by_exprs: &[SqlExpression],
) -> usize
 
pub fn estimate_group_cardinality( &self, view: &DataView, group_by_exprs: &[SqlExpression], ) -> usize
Estimate the cardinality (number of unique groups) for GROUP BY operations This helps pre-size hash tables for better performance
Trait Implementations§
Source§impl Clone for QueryEngine
 
impl Clone for QueryEngine
Source§fn clone(&self) -> QueryEngine
 
fn clone(&self) -> QueryEngine
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreSource§impl Default for QueryEngine
 
impl Default for QueryEngine
Source§impl GroupByExpressions for QueryEngine
 
impl GroupByExpressions for QueryEngine
Source§fn group_by_expressions(
    &self,
    view: DataView,
    group_by_exprs: &[SqlExpression],
) -> Result<FxHashMap<GroupKey, DataView>>
 
fn group_by_expressions( &self, view: DataView, group_by_exprs: &[SqlExpression], ) -> Result<FxHashMap<GroupKey, DataView>>
Group rows by evaluating expressions for each row
Source§fn apply_group_by_expressions(
    &self,
    view: DataView,
    group_by_exprs: &[SqlExpression],
    select_items: &[SelectItem],
    having: Option<&SqlExpression>,
    _case_insensitive: bool,
    date_notation: String,
) -> Result<(DataView, GroupByPhaseInfo)>
 
fn apply_group_by_expressions( &self, view: DataView, group_by_exprs: &[SqlExpression], select_items: &[SelectItem], having: Option<&SqlExpression>, _case_insensitive: bool, date_notation: String, ) -> Result<(DataView, GroupByPhaseInfo)>
Apply GROUP BY with expressions to the view
Auto Trait Implementations§
impl Freeze for QueryEngine
impl RefUnwindSafe for QueryEngine
impl Send for QueryEngine
impl Sync for QueryEngine
impl Unpin for QueryEngine
impl UnwindSafe for QueryEngine
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> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
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