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

Function rank

src/expr/src/relation/func.rs:495–505  ·  view source on GitHub ↗

The expected input is in the format of `[((OriginalRow, [EncodedArgs]), OrderByExprs...)]` The output is in the format of `[result_value, original_row]`. See an example at `lag_lead`, where the input-output formats are similar.

(datums: I, callers_temp_storage: &'a RowArena, order_by: &[ColumnOrder])

Source from the content-addressed store, hash-verified

493/// The output is in the format of `[result_value, original_row]`.
494/// See an example at `lag_lead`, where the input-output formats are similar.
495fn rank<'a, I>(datums: I, callers_temp_storage: &'a RowArena, order_by: &[ColumnOrder]) -> Datum<'a>
496where
497 I: IntoIterator<Item = Datum<'a>>,
498{
499 let temp_storage = RowArena::new();
500 let datums = rank_no_list(datums, &temp_storage, order_by);
501
502 callers_temp_storage.make_datum(|packer| {
503 packer.push_list(datums);
504 })
505}
506
507/// Like `rank`, but doesn't perform the final wrapping in a list, returning an Iterator
508/// instead.

Callers 1

eval_datumsMethod · 0.85

Calls 3

rank_no_listFunction · 0.85
make_datumMethod · 0.80
push_listMethod · 0.80

Tested by

no test coverage detected