Count rows per user_id in orders and return as order_count. Sort by user_id ascending.
| user_id | order_id |
|---|---|
| 3 | 1 |
| 4 | 2 |
| 1 | 3 |
| 4 | 4 |
| 2 | 5 |
| 4 | 6 |
These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].
orders10 rows| user_id (int) | order_id (int) |
|---|---|
| 3 | 1 |
| 4 | 2 |
| 1 | 3 |
| 4 | 4 |
| 2 | 5 |
| 4 | 6 |
| 3 | 7 |
| 1 | 8 |
| 2 | 9 |
| 3 | 10 |
Column names and order must match. Sort order is specified in the question.