The sales table contains individual sales rows.
Return product_id, units_sold for the product with the highest total units. If two products tie, choose the smaller product_id. Return exactly one row.
These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].
sales6 rows| sale_id (int) | product_id (string) | units (int) |
|---|---|---|
| 1 | P1 | 5 |
| 2 | P2 | 8 |
| 3 | P1 | 4 |
| 4 | P3 | 8 |
| 5 | P2 | 1 |
| 6 | P4 | 2 |
Column names and order must match. Sort order is specified in the question.