A subscription is active in month 12 when start_month <= 12 and end_month >= 12.
Return account_id, plan, monthly_fee for active accounts. Sort by account_id ascending.
These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].
subscriptions7 rows| account_id (int) | plan (string) | start_month (int) | end_month (int) | monthly_fee (double) |
|---|---|---|---|---|
| 1 | Basic | 1 | 6 | 9.99 |
| 2 | Pro | 3 | 12 | 29.99 |
| 3 | Team | 6 | 18 | 99 |
| 4 | Basic | 2 | 4 | 9.99 |
| 5 | Pro | 10 | 10 | 29.99 |
| 6 | Enterprise | 1 | 24 | 199 |
| 7 | Pro | 12 | 12 | 29.99 |
Column names and order must match. Sort order is specified in the question.