The inventory table records stock and capacity by warehouse.
Return warehouse, product_id, utilization_pct for rows where stock is below 25% of capacity. Round utilization to 2 decimal places. Sort by warehouse, then product_id ascending.
These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].
inventory8 rows| warehouse (string) | product_id (string) | stock (int) | capacity (int) |
|---|---|---|---|
| WH1 | P1 | 20 | 100 |
| WH1 | P2 | 30 | 100 |
| WH2 | P3 | 10 | 40 |
| WH2 | P4 | 5 | 50 |
| WH3 | P5 | 0 | 20 |
| WH3 | P6 | 49 | 50 |
| WH4 | P7 | 12 | 100 |
| WH4 | P8 | 25 | 100 |
Column names and order must match. Sort order is specified in the question.