Skip to main content

QueryOutputRewriter

Trait QueryOutputRewriter 

Source
pub trait QueryOutputRewriter: Sync {
    // Required methods
    fn prune_query_outputs(
        &self,
        query: &mut QueryPlan,
        aliases: &[String],
        projection: &SourceProjection,
        schema: &RowSchema,
        visible_ctes: &dyn Fn(&str) -> bool,
    ) -> Result<(), SQLError>;
    fn optimize_retained_query(
        &self,
        query: &QueryPlan,
    ) -> Result<QueryPlan, SQLError>;
    fn push_output_filter(
        &self,
        query: &QueryPlan,
        qualifier: &str,
        filter: &ScalarExpr,
        output_columns: Option<&[String]>,
    ) -> Result<Option<QueryPlan>, SQLError>;

    // Provided method
    fn push_derived_output_filter(
        &self,
        query: &QueryPlan,
        qualifier: &str,
        filter: &ScalarExpr,
        output_columns: Option<&[String]>,
    ) -> Result<Option<QueryPlan>, SQLError> { ... }
}

Required Methods§

Source

fn prune_query_outputs( &self, query: &mut QueryPlan, aliases: &[String], projection: &SourceProjection, schema: &RowSchema, visible_ctes: &dyn Fn(&str) -> bool, ) -> Result<(), SQLError>

Remove scalar output expressions the containing query does not need, preserving the stored row descriptor and side effects.

Source

fn optimize_retained_query( &self, query: &QueryPlan, ) -> Result<QueryPlan, SQLError>

Optimize a catalog-retained query before assembling either its streaming or materialized execution path.

Source

fn push_output_filter( &self, query: &QueryPlan, qualifier: &str, filter: &ScalarExpr, output_columns: Option<&[String]>, ) -> Result<Option<QueryPlan>, SQLError>

Return a plan that applies the complete output predicate, or None when the caller must retain it.

Provided Methods§

Source

fn push_derived_output_filter( &self, query: &QueryPlan, qualifier: &str, filter: &ScalarExpr, output_columns: Option<&[String]>, ) -> Result<Option<QueryPlan>, SQLError>

Place a predicate inside an ordinary derived source. Recursive specialization keeps its separate effect boundary through push_output_filter.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§