I need to calculate the number of consecutive days from today (2022-01-04) backwards a client logged in my application. I need to use pyspark due to the size of my database
Input
Name Date
John 2022-01-01
John 2022-01-01
Mary 2022-01-01
Steve 2022-01-03
Mary 2022-01-03
John 2022-01-02
John 2022-01-03
Mary 2022-01-04
John 2022-01-04
Output
Name consecutive_days
John 4
Mary 2