I have a dataframe like this:
| time |
|---|
| First |
| Second |
| Third |
I would like to have an output like this using Pyspark, where I create an interval with the row itself and its subsequent row:
| time | start | end |
|---|---|---|
| First | First | Second |
| Second | Second | Third |
| Third | ... | .... |
Do you have any suggestions?