Inner-join orders with users on user_id. Return order_id, name, amount sorted by order_id ascending. Drop orders whose user_id is not in users.
These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].
users5 rows| user_id (int) | name (string) |
|---|---|
| 1 | Aarav |
| 2 | Priya |
| 3 | Rohan |
| 4 | Isha |
| 5 | Kabir |
orders8 rows| order_id (int) | user_id (int) | amount (double) |
|---|---|---|
| 100 | 3 | 30.18 |
| 101 | 4 | 250.46 |
| 102 | 3 | 65.14 |
| 103 | 6 | 78.18 |
| 104 | 7 | 111.78 |
| 105 | 5 | 282.98 |
| 106 | 5 | 128.6 |
| 107 | 5 | 208.1 |
Column names and order must match. Sort order is specified in the question.