| <table class="table"> |
| <thead> |
| <tr> |
| <th style="width:25%">Function</th> |
| <th>Description</th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td>cume_dist()</td> |
| <td>Computes the position of a value relative to all values in the partition.</td> |
| </tr> |
| <tr> |
| <td>dense_rank()</td> |
| <td>Computes the rank of a value in a group of values. The result is one plus the |
| previously assigned rank value. Unlike the function rank, dense_rank will not produce gaps |
| in the ranking sequence.</td> |
| </tr> |
| <tr> |
| <td>lag(input[, offset[, default]])</td> |
| <td>Returns the value of `input` at the `offset`th row |
| before the current row in the window. The default value of `offset` is 1 and the default |
| value of `default` is null. If the value of `input` at the `offset`th row is null, |
| null is returned. If there is no such offset row (e.g., when the offset is 1, the first |
| row of the window does not have any previous row), `default` is returned.</td> |
| </tr> |
| <tr> |
| <td>lead(input[, offset[, default]])</td> |
| <td>Returns the value of `input` at the `offset`th row |
| after the current row in the window. The default value of `offset` is 1 and the default |
| value of `default` is null. If the value of `input` at the `offset`th row is null, |
| null is returned. If there is no such an offset row (e.g., when the offset is 1, the last |
| row of the window does not have any subsequent row), `default` is returned.</td> |
| </tr> |
| <tr> |
| <td>nth_value(input[, offset])</td> |
| <td>Returns the value of `input` at the row that is the `offset`th row |
| from beginning of the window frame. Offset starts at 1. If ignoreNulls=true, we will skip |
| nulls when finding the `offset`th row. Otherwise, every row counts for the `offset`. If |
| there is no such an `offset`th row (e.g., when the offset is 10, size of the window frame |
| is less than 10), null is returned.</td> |
| </tr> |
| <tr> |
| <td>ntile(n)</td> |
| <td>Divides the rows for each window partition into `n` buckets ranging |
| from 1 to at most `n`.</td> |
| </tr> |
| <tr> |
| <td>percent_rank()</td> |
| <td>Computes the percentage ranking of a value in a group of values.</td> |
| </tr> |
| <tr> |
| <td>rank()</td> |
| <td>Computes the rank of a value in a group of values. The result is one plus the number |
| of rows preceding or equal to the current row in the ordering of the partition. The values |
| will produce gaps in the sequence.</td> |
| </tr> |
| <tr> |
| <td>row_number()</td> |
| <td>Assigns a unique, sequential number to each row, starting with one, |
| according to the ordering of rows within the window partition.</td> |
| </tr> |
| </tbody> |
| </table> |