rank() -> int64

rank() assigns int64 ranks within a window partition based on the window ordering, giving tied rows the same rank and leaving gaps before the next rank so that the next rank reflects one plus the number of prior rows. It takes no arguments and must run inside window with configured group_by and order_by. Compare dense_rank, which closes those gaps after ties.

Domain

This is a window function (calculates over a group of multiple input rows using windowing).

Categories

Examples

make_col rk:window(rank(), group_by(region), order_by(score))

Standard competition ranking by score inside each region, leaving gaps after tied ranks.