I would like help with collapsing time intervals that overlap each other within each group.
Specifically, this is what I have:
| id | time_start | time_end |
|---|---|---|
| 1 | 8:00 | 9:00 |
| 1 | 8:30 | 9:30 |
| 1 | 9:45 | 10:00 |
| 2 | 8:00 | 9:00 |
| 2 | 8:30 | 8:40 |
This is what I desire:
| id | time_start | time_end |
|---|---|---|
| 1 | 8:00 | 9:30 |
| 1 | 9:45 | 10:00 |
| 2 | 8:00 | 9:00 |
The data is very large and needs to be handled as a Spark dataframe.
Appreciate any help!