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

Method eval

src/expr/src/scalar/func/impls/map.rs:38–51  ·  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

36
37impl LazyUnaryFunc for CastMapToString {
38 fn eval<'a>(
39 &'a self,
40 datums: &[Datum<'a>],
41 temp_storage: &'a RowArena,
42 a: &'a impl Eval,
43 ) -> Result<Datum<'a>, EvalError> {
44 let a = a.eval(datums, temp_storage)?;
45 if a.is_null() {
46 return Ok(Datum::Null);
47 }
48 let mut buf = String::new();
49 stringify_datum(&mut buf, a, &self.ty)?;
50 Ok(Datum::String(temp_storage.push_string(buf)))
51 }
52
53 fn output_sql_type(&self, input_type: SqlColumnType) -> SqlColumnType {
54 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
unwrap_strMethod · 0.80
make_datumMethod · 0.80
push_dictMethod · 0.80
is_nullMethod · 0.45
iterMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected