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

Method call

src/expr/src/scalar/func/variadic.rs:573–599  ·  view source on GitHub ↗
(
        &self,
        (lower, upper, flags_datum): Self::Input<'a>,
        temp_storage: &'a RowArena,
    )

Source from the content-addressed store, hash-verified

571 type Output<'a> = Result<Datum<'a>, EvalError>;
572
573 fn call<'a>(
574 &self,
575 (lower, upper, flags_datum): Self::Input<'a>,
576 temp_storage: &'a RowArena,
577 ) -> Self::Output<'a> {
578 let flags = match flags_datum {
579 Datum::Null => {
580 return Err(EvalError::InvalidRange(
581 InvalidRangeError::NullRangeBoundFlags,
582 ));
583 }
584 o => o.unwrap_str(),
585 };
586
587 let (lower_inclusive, upper_inclusive) = parse_range_bound_flags(flags)?;
588
589 let mut range = Range::new(Some((
590 RangeBound::new(lower, lower_inclusive),
591 RangeBound::new(upper, upper_inclusive),
592 )));
593
594 range.canonicalize()?;
595
596 Ok(temp_storage.make_datum(|row| {
597 row.push_range(range).expect("errors already handled");
598 }))
599 }
600
601 fn output_type(&self, _input_types: &[SqlColumnType]) -> SqlColumnType {
602 SqlScalarType::Range {

Callers 3

evalMethod · 0.45
evalMethod · 0.45
evalMethod · 0.45

Calls 6

parse_range_bound_flagsFunction · 0.85
unwrap_strMethod · 0.80
make_datumMethod · 0.80
expectMethod · 0.80
push_rangeMethod · 0.80
canonicalizeMethod · 0.45

Tested by

no test coverage detected