The rides table records tips for each ride.
Return driver_id, avg_tip, the average tip per driver rounded to 2 decimal places. Sort by driver_id ascending.
These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].
rides8 rows| ride_id (int) | driver_id (int) | tip (double) |
|---|---|---|
| 1 | 1 | 2 |
| 2 | 1 | 3 |
| 3 | 2 | 5 |
| 4 | 3 | 1.5 |
| 5 | 3 | 2.5 |
| 6 | 4 | 0 |
| 7 | 5 | 4.5 |
| 8 | 6 | 3.5 |
Column names and order must match. Sort order is specified in the question.