pub trait Interpreter {
type Domain: Debug + Sized;
// Required methods
fn constant(
&self,
ctx: &Context<Self::Domain>,
rows: &Result<Vec<(Row, Timestamp, 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: &MfpPlan<LirScalarExpr>,
input_key_val: &Option<(Vec<LirScalarExpr>, Option<Row>)>,
) -> Self::Domain;
fn flat_map(
&self,
ctx: &Context<Self::Domain>,
input_key: &Option<Vec<LirScalarExpr>>,
input: Self::Domain,
exprs: &Vec<LirScalarExpr>,
func: &TableFunc,
mfp: &MfpPlan<LirScalarExpr>,
) -> 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_key: &Option<Vec<LirScalarExpr>>,
input: Self::Domain,
key_val_plan: &KeyValPlan,
plan: &ReducePlan,
mfp_after: &SafeMfpPlan<LirScalarExpr>,
) -> 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<LirScalarExpr>>,
input_mfp: &MfpPlan<LirScalarExpr>,
) -> Self::Domain;
}Expand description
An abstract interpreter for LirRelationExpr expressions.
This is an object algebra / tagless final encoding of the language
defined by crate::plan::LirRelationExpr, 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.
TODO(database-issues#7446): align this with the LirRelationExpr structure
Required Associated Types§
Required Methods§
Sourcefn constant(
&self,
ctx: &Context<Self::Domain>,
rows: &Result<Vec<(Row, Timestamp, Diff)>, EvalError>,
) -> Self::Domain
fn constant( &self, ctx: &Context<Self::Domain>, rows: &Result<Vec<(Row, Timestamp, Diff)>, EvalError>, ) -> Self::Domain
TODO(database-issues#7533): Add documentation.
Sourcefn get(
&self,
ctx: &Context<Self::Domain>,
id: &Id,
keys: &AvailableCollections,
plan: &GetPlan,
) -> Self::Domain
fn get( &self, ctx: &Context<Self::Domain>, id: &Id, keys: &AvailableCollections, plan: &GetPlan, ) -> Self::Domain
TODO(database-issues#7533): Add documentation.
Sourcefn mfp(
&self,
ctx: &Context<Self::Domain>,
input: Self::Domain,
mfp: &MfpPlan<LirScalarExpr>,
input_key_val: &Option<(Vec<LirScalarExpr>, Option<Row>)>,
) -> Self::Domain
fn mfp( &self, ctx: &Context<Self::Domain>, input: Self::Domain, mfp: &MfpPlan<LirScalarExpr>, input_key_val: &Option<(Vec<LirScalarExpr>, Option<Row>)>, ) -> Self::Domain
TODO(database-issues#7533): Add documentation.
Sourcefn flat_map(
&self,
ctx: &Context<Self::Domain>,
input_key: &Option<Vec<LirScalarExpr>>,
input: Self::Domain,
exprs: &Vec<LirScalarExpr>,
func: &TableFunc,
mfp: &MfpPlan<LirScalarExpr>,
) -> Self::Domain
fn flat_map( &self, ctx: &Context<Self::Domain>, input_key: &Option<Vec<LirScalarExpr>>, input: Self::Domain, exprs: &Vec<LirScalarExpr>, func: &TableFunc, mfp: &MfpPlan<LirScalarExpr>, ) -> Self::Domain
TODO(database-issues#7533): Add documentation.
Sourcefn join(
&self,
ctx: &Context<Self::Domain>,
inputs: Vec<Self::Domain>,
plan: &JoinPlan,
) -> Self::Domain
fn join( &self, ctx: &Context<Self::Domain>, inputs: Vec<Self::Domain>, plan: &JoinPlan, ) -> Self::Domain
TODO(database-issues#7533): Add documentation.
Sourcefn reduce(
&self,
ctx: &Context<Self::Domain>,
input_key: &Option<Vec<LirScalarExpr>>,
input: Self::Domain,
key_val_plan: &KeyValPlan,
plan: &ReducePlan,
mfp_after: &SafeMfpPlan<LirScalarExpr>,
) -> Self::Domain
fn reduce( &self, ctx: &Context<Self::Domain>, input_key: &Option<Vec<LirScalarExpr>>, input: Self::Domain, key_val_plan: &KeyValPlan, plan: &ReducePlan, mfp_after: &SafeMfpPlan<LirScalarExpr>, ) -> Self::Domain
TODO(database-issues#7533): Add documentation.
Sourcefn top_k(
&self,
ctx: &Context<Self::Domain>,
input: Self::Domain,
top_k_plan: &TopKPlan,
) -> Self::Domain
fn top_k( &self, ctx: &Context<Self::Domain>, input: Self::Domain, top_k_plan: &TopKPlan, ) -> Self::Domain
TODO(database-issues#7533): Add documentation.
Sourcefn negate(
&self,
ctx: &Context<Self::Domain>,
input: Self::Domain,
) -> Self::Domain
fn negate( &self, ctx: &Context<Self::Domain>, input: Self::Domain, ) -> Self::Domain
TODO(database-issues#7533): Add documentation.
Sourcefn threshold(
&self,
ctx: &Context<Self::Domain>,
input: Self::Domain,
threshold_plan: &ThresholdPlan,
) -> Self::Domain
fn threshold( &self, ctx: &Context<Self::Domain>, input: Self::Domain, threshold_plan: &ThresholdPlan, ) -> Self::Domain
TODO(database-issues#7533): Add documentation.
Sourcefn union(
&self,
ctx: &Context<Self::Domain>,
inputs: Vec<Self::Domain>,
consolidate_output: bool,
) -> Self::Domain
fn union( &self, ctx: &Context<Self::Domain>, inputs: Vec<Self::Domain>, consolidate_output: bool, ) -> Self::Domain
TODO(database-issues#7533): Add documentation.
Sourcefn arrange_by(
&self,
ctx: &Context<Self::Domain>,
input: Self::Domain,
forms: &AvailableCollections,
input_key: &Option<Vec<LirScalarExpr>>,
input_mfp: &MfpPlan<LirScalarExpr>,
) -> Self::Domain
fn arrange_by( &self, ctx: &Context<Self::Domain>, input: Self::Domain, forms: &AvailableCollections, input_key: &Option<Vec<LirScalarExpr>>, input_mfp: &MfpPlan<LirScalarExpr>, ) -> Self::Domain
TODO(database-issues#7533): Add documentation.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".