MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / mfp_filter

Method mfp_filter

src/expr/src/interpret.rs:1080–1092  ·  view source on GitHub ↗

Override the default implementations of [Self::mfp_filter] and [Self::mfp_plan_filter] so that the fallibility of MFP expressions surfaces in the result, even when the expression's result column isn't referenced by a predicate or temporal bound. The runtime MFP evaluator runs every expression once all the preceding predicates pass (see [`crate::SafeMfpPlan::evaluate_inner`]), so an expression tha

(&self, mfp: &MapFilterProject)

Source from the content-addressed store, hash-verified

1078 /// `fallible` flag and persist filter pushdown can wrongly discard a part
1079 /// that actually produces error rows. See database-issues#9656.
1080 fn mfp_filter(&self, mfp: &MapFilterProject) -> Self::Summary {
1081 let mfp_eval = MfpEval::new(self, mfp.input_arity, &mfp.expressions);
1082 let predicates = mfp
1083 .predicates
1084 .iter()
1085 .map(|(_, e)| mfp_eval.expr(e))
1086 .collect();
1087 let mut result = self.variadic(&And.into(), predicates);
1088 if mfp_eval.expressions.iter().any(|s| s.range.fallible) {
1089 result.range.fallible = true;
1090 }
1091 result
1092 }
1093
1094 fn mfp_plan_filter(&self, plan: &MfpPlan) -> Self::Summary {
1095 let mfp_eval = MfpEval::new(self, plan.mfp.input_arity, &plan.mfp.expressions);

Callers 4

checkFunction · 0.45
test_mfpFunction · 0.45
may_match_mfpMethod · 0.45

Calls 6

anyMethod · 0.80
collectMethod · 0.45
mapMethod · 0.45
iterMethod · 0.45
exprMethod · 0.45
variadicMethod · 0.45

Tested by 2

test_mfpFunction · 0.36