I'm trying to generate a DataFrame in Spark (but perhaps just Scala is enough) in which I have every combination of the last 24 months where the second year-month is always > the first year-month.
For example, it is the 1 March 2019 as of writing this, I'm after something like:
List(
(2017, 3, 2017, 4),
(2017, 3, 2017, 5),
(2017, 3, 2017, 6),
// ..
(2017, 3, 2019, 3),
(2017, 4, 2017, 5),
// ..
(2019, 1, 2019, 3),
(2019, 2, 2019, 3),
)