pub trait Interpreter<T = Timestamp> {
    type Domain: Debug + Sized;

    // Required methods
    fn constant(
        &self,
        ctx: &Context<Self::Domain>,
        rows: &Result<Vec<(Row, T, Diff)>, EvalError>
    ) -> Self::Domain;
    fn get(
        &self,
        ctx: &Context<Self::Domain>,
        id: &Id,
        keys: &AvailableCollections,
        plan: &GetPlan
    ) -> Self::Domain;
    fn mfp(
        &self,
        ctx: &Context<Self::Domain>,
        input: Self::Domain,
        mfp: &MapFilterProject,
        input_key_val: &Option<(Vec<MirScalarExpr>, Option<Row>)>
    ) -> Self::Domain;
    fn flat_map(
        &self,
        ctx: &Context<Self::Domain>,
        input: Self::Domain,
        func: &TableFunc,
        exprs: &Vec<MirScalarExpr>,
        mfp: &MapFilterProject,
        input_key: &Option<Vec<MirScalarExpr>>
    ) -> Self::Domain;
    fn join(
        &self,
        ctx: &Context<Self::Domain>,
        inputs: Vec<Self::Domain>,
        plan: &JoinPlan
    ) -> Self::Domain;
    fn reduce(
        &self,
        ctx: &Context<Self::Domain>,
        input: Self::Domain,
        key_val_plan: &KeyValPlan,
        plan: &ReducePlan,
        input_key: &Option<Vec<MirScalarExpr>>
    ) -> Self::Domain;
    fn top_k(
        &self,
        ctx: &Context<Self::Domain>,
        input: Self::Domain,
        top_k_plan: &TopKPlan
    ) -> Self::Domain;
    fn negate(
        &self,
        ctx: &Context<Self::Domain>,
        input: Self::Domain
    ) -> Self::Domain;
    fn threshold(
        &self,
        ctx: &Context<Self::Domain>,
        input: Self::Domain,
        threshold_plan: &ThresholdPlan
    ) -> Self::Domain;
    fn union(
        &self,
        ctx: &Context<Self::Domain>,
        inputs: Vec<Self::Domain>,
        consolidate_output: bool
    ) -> Self::Domain;
    fn arrange_by(
        &self,
        ctx: &Context<Self::Domain>,
        input: Self::Domain,
        forms: &AvailableCollections,
        input_key: &Option<Vec<MirScalarExpr>>,
        input_mfp: &MapFilterProject
    ) -> Self::Domain;
}
Expand description

An abstract interpreter for Plan expressions.

This is an object algebra / tagless final encoding of the language defined by crate::plan::Plan, with the exception of the Let* variants. The latter are modeled as part of the various recursion methods, as they are constructs to introduce and reference context.

Required Associated Types§

Required Methods§

source

fn constant( &self, ctx: &Context<Self::Domain>, rows: &Result<Vec<(Row, T, Diff)>, EvalError> ) -> Self::Domain

source

fn get( &self, ctx: &Context<Self::Domain>, id: &Id, keys: &AvailableCollections, plan: &GetPlan ) -> Self::Domain

source

fn mfp( &self, ctx: &Context<Self::Domain>, input: Self::Domain, mfp: &MapFilterProject, input_key_val: &Option<(Vec<MirScalarExpr>, Option<Row>)> ) -> Self::Domain

source

fn flat_map( &self, ctx: &Context<Self::Domain>, input: Self::Domain, func: &TableFunc, exprs: &Vec<MirScalarExpr>, mfp: &MapFilterProject, input_key: &Option<Vec<MirScalarExpr>> ) -> Self::Domain

source

fn join( &self, ctx: &Context<Self::Domain>, inputs: Vec<Self::Domain>, plan: &JoinPlan ) -> Self::Domain

source

fn reduce( &self, ctx: &Context<Self::Domain>, input: Self::Domain, key_val_plan: &KeyValPlan, plan: &ReducePlan, input_key: &Option<Vec<MirScalarExpr>> ) -> Self::Domain

source

fn top_k( &self, ctx: &Context<Self::Domain>, input: Self::Domain, top_k_plan: &TopKPlan ) -> Self::Domain

source

fn negate( &self, ctx: &Context<Self::Domain>, input: Self::Domain ) -> Self::Domain

source

fn threshold( &self, ctx: &Context<Self::Domain>, input: Self::Domain, threshold_plan: &ThresholdPlan ) -> Self::Domain

source

fn union( &self, ctx: &Context<Self::Domain>, inputs: Vec<Self::Domain>, consolidate_output: bool ) -> Self::Domain

source

fn arrange_by( &self, ctx: &Context<Self::Domain>, input: Self::Domain, forms: &AvailableCollections, input_key: &Option<Vec<MirScalarExpr>>, input_mfp: &MapFilterProject ) -> Self::Domain

Implementors§