The sales table records daily sales for each region.
Return region, sale_day, sale_id, amount, region_running_total, where region_running_total accumulates sales within each region from the earliest day through the current row. Sort by region, then sale_day, then sale_id ascending.
These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].
sales7 rows| sale_id (int) | region (string) | sale_day (int) | amount (double) |
|---|---|---|---|
| 1 | East | 1 | 100 |
| 2 | West | 1 | 80 |
| 3 | East | 2 | 50 |
| 4 | West | 2 | 20 |
| 5 | East | 3 | 30 |
| 6 | West | 3 | 70 |
| 7 | East | 4 | 10 |
Column names and order must match. Sort order is specified in the question.