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

Function max_string

src/expr/src/relation/func.rs:56–68  ·  view source on GitHub ↗
(datums: I)

Source from the content-addressed store, hash-verified

54// see https://timely.zulipchat.com/#narrow/stream/186635-engineering/topic/additional.20work/near/163507435
55
56fn max_string<'a, I>(datums: I) -> Datum<'a>
57where
58 I: IntoIterator<Item = Datum<'a>>,
59{
60 match datums
61 .into_iter()
62 .filter(|d| !d.is_null())
63 .max_by(|a, b| a.unwrap_str().cmp(b.unwrap_str()))
64 {
65 Some(datum) => datum,
66 None => Datum::Null,
67 }
68}
69
70fn max_datum<'a, I, DatumType>(datums: I) -> Datum<'a>
71where

Callers 2

eval_datumsMethod · 0.85
from_columnMethod · 0.85

Calls 5

unwrap_strMethod · 0.80
filterMethod · 0.45
into_iterMethod · 0.45
is_nullMethod · 0.45
cmpMethod · 0.45

Tested by

no test coverage detected