Rank players by score descending using dense_rank (ties share the same rank). Return player_id, score, rank sorted by rank asc then player_id asc.
| player_id | score |
|---|---|
| 1 | 60 |
| 2 | 100 |
| 3 | 70 |
| 4 | 80 |
| 5 | 90 |
| 6 | 50 |
These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].
players8 rows| player_id (int) | score (int) |
|---|---|
| 1 | 60 |
| 2 | 100 |
| 3 | 70 |
| 4 | 80 |
| 5 | 90 |
| 6 | 50 |
| 7 | 100 |
| 8 | 50 |
Column names and order must match. Sort order is specified in the question.