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

Method on_unique_first_value_last_value

src/expr/src/relation.rs:3156–3168  ·  view source on GitHub ↗

`on_unique` for `first_value` and `last_value`

(
        window_frame: &WindowFrame,
        arg: MirScalarExpr,
        return_type: ReprScalarType,
    )

Source from the content-addressed store, hash-verified

3154
3155 /// `on_unique` for `first_value` and `last_value`
3156 fn on_unique_first_value_last_value(
3157 window_frame: &WindowFrame,
3158 arg: MirScalarExpr,
3159 return_type: ReprScalarType,
3160 ) -> (MirScalarExpr, ColumnName) {
3161 // If the window frame includes the current (single) row, return its value, null otherwise
3162 let result_expr = if window_frame.includes_current_row() {
3163 arg
3164 } else {
3165 MirScalarExpr::literal_null(return_type)
3166 };
3167 (result_expr, ColumnName::from("?first_value?"))
3168 }
3169
3170 /// `on_unique` for window aggregations
3171 fn on_unique_window_agg(

Callers

nothing calls this directly

Calls 1

includes_current_rowMethod · 0.80

Tested by

no test coverage detected