Compute min_price and max_price per product_id. Sort by product_id asc.
These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].
prices12 rows| product_id (int) | price (double) |
|---|---|
| 4 | 318.64 |
| 4 | 278.52 |
| 1 | 53.4 |
| 3 | 260.03 |
| 2 | 307.91 |
| 1 | 218.57 |
| 3 | 239.13 |
| 2 | 70.19 |
| 3 | 390.71 |
| 3 | 168.77 |
| 3 | 10.41 |
| 2 | 44.87 |
Column names and order must match. Sort order is specified in the question.