stupidb.functions.ranking
Navigation and simple window function interface and implementation.
Classes
AbstractRank(order_by_values)
|
A class represnting a numerical ordering of rows. |
DenseRank(order_by_values)
|
Dense ranking computation. |
Rank(order_by_values)
|
Non-dense ranking computation. |
RowNumber(order_by_values)
|
Row number analytic function. |
Sentinel()
|
A class that is not equal to anything except instances of itself. |
-
class stupidb.functions.ranking.AbstractRank(order_by_values)[source]
A class represnting a numerical ordering of rows.
-
execute(begin, end)[source]
Compute an abstract row rank value for rows between begin and end.
- Return type
int
-
abstract rank(current_order_by_value, current_row_number)[source]
Compute the rank of the current row.
- Return type
int
-
class stupidb.functions.ranking.DenseRank(order_by_values)[source]
Dense ranking computation.
-
rank(current_order_by_value, current_row_number)[source]
Compute the current rank, densely.
- Return type
int
-
class stupidb.functions.ranking.Rank(order_by_values)[source]
Non-dense ranking computation.
-
rank(current_order_by_value, current_row_number)[source]
Rank the current row according to current_order_by_value.
- Return type
int
-
class stupidb.functions.ranking.RowNumber(order_by_values)[source]
Row number analytic function.
-
execute(begin, end)[source]
Compute an abstract row rank value for rows between begin and end.
- Return type
int
-
class stupidb.functions.ranking.Sentinel[source]
A class that is not equal to anything except instances of itself.
This class is used as the starting value for stupidb.ranking.Rank
and stupidb.ranking.DenseRank because their algorithms compare the
previous ORDER BY value in the sequence to determine whether to
increase the rank.
Modules