I am new to spark and scala and I would like to convert a column of string dates, into Unix epochs. My dataframe looks like this:
+----------+-------+
| Dates |Reports|
+----------+-------+
|2020-07-20| 34|
|2020-07-21| 86|
|2020-07-22| 129|
|2020-07-23| 98|
+--------+---------+
The output should be
+----------+-------+
| Dates |Reports|
+----------+-------+
|1595203200| 34|
|1595289600| 86|
|1595376000| 129|
|1595462400| 98|
+--------+---------+
``