spark how to reduce by column of data type is date
0 1 I am working on a DataFrame looks as follows: ------------------------------- | time | value | ------------------------------- | 2014-12-01 02:54:00 | 2 | | 2014-12-01 03:54:00 | 3 | | 2014-12-01 04:54:00 | 4 | | 2014-12-01 05:54:00 | 5 | | 2014-12-02 02:54:00 | 6 | | 2014-12-02 02:54:00 | 7 | | 2014-12-03 02:54:00 | 8 | ------------------------------- the number of samples on each day is pretty random. I want to get just one sample on each day, such as: ------------------------------- | time | value | ------------------------------- | 2014-12-01 02:54:00 | 2 | | 2014-12-02 02:54:00 | 6 | | 2014-12-03 02:54:00 | 8 | ------------------------------- I don't care about which sample I get from one day, but I want to make sure to get one so there is no day duplication on "time" column. apache-spark apache-zeppelin share | improve this question edited Nov 13 '18 at 18:44 Psidom 124k 12 86 128 asked Nov 13 '18 at 18:41 B