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

Method eval

src/expr/src/scalar/func/impls/record.rs:37–50  ·  view source on GitHub ↗
(
        &'a self,
        datums: &[Datum<'a>],
        temp_storage: &'a RowArena,
        a: &'a impl Eval,
    )

Source from the content-addressed store, hash-verified

35
36impl LazyUnaryFunc for CastRecordToString {
37 fn eval<'a>(
38 &'a self,
39 datums: &[Datum<'a>],
40 temp_storage: &'a RowArena,
41 a: &'a impl Eval,
42 ) -> Result<Datum<'a>, EvalError> {
43 let a = a.eval(datums, temp_storage)?;
44 if a.is_null() {
45 return Ok(Datum::Null);
46 }
47 let mut buf = String::new();
48 stringify_datum(&mut buf, a, &self.ty)?;
49 Ok(Datum::String(temp_storage.push_string(buf)))
50 }
51
52 fn output_sql_type(&self, input_type: SqlColumnType) -> SqlColumnType {
53 SqlScalarType::String.nullable(input_type.nullable)

Callers

nothing calls this directly

Calls 10

stringify_datumFunction · 0.85
StringClass · 0.85
push_stringMethod · 0.80
unwrap_listMethod · 0.80
make_datumMethod · 0.80
push_listMethod · 0.80
unwrapMethod · 0.80
is_nullMethod · 0.45
iterMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected