I want to create a dataframe in Scala with all dates from a start date to an end date.
I can get an Array of dates using this expression
val dates = sqlContext.sql("SELECT sequence(to_date('2018-01-01'), to_date('2018-02-01'), interval 1 day) as dates")
+--------------------+
| dates|
+--------------------+
|[2018-01-01, 2018...|
+--------------------+
This gives me a dataframe with one column and one row. I rather want one row for each date and not an array with all the dates as I have now
How can I achieve this?
+--------------------+
| dates|
+--------------------+
|[2018-01-01|
|[2018-01-02|
|[2018-01-03|
|[2018-01-04|
etc.....
+--------------------+