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

Method might_error

src/expr/src/scalar.rs:646–655  ·  view source on GitHub ↗

A very crude approximation for scalar expressions that might produce an error. Currently, this is restricted only to expressions that either contain a literal error or a [`VariadicFunc::ErrorIfNull`] call.

(&self)

Source from the content-addressed store, hash-verified

644 /// Currently, this is restricted only to expressions that either contain a
645 /// literal error or a [`VariadicFunc::ErrorIfNull`] call.
646 pub fn might_error(&self) -> bool {
647 let mut worklist = vec![self];
648 while let Some(expr) = worklist.pop() {
649 if expr.is_literal_err() || expr.is_error_if_null() {
650 return true;
651 }
652 worklist.extend(expr.children());
653 }
654 false
655 }
656
657 /// Reduces a complex expression where possible.
658 ///

Callers 1

newMethod · 0.80

Calls 5

is_error_if_nullMethod · 0.80
childrenMethod · 0.65
popMethod · 0.45
is_literal_errMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected