Find streaks of consecutive dates and group them into batches.
If dates are Jan 1, Jan 2, Jan 4, Jan 5:
| log_id(INTEGER) | execution_date(DATE) |
|---|---|
| 1 | 2026-01-01 |
| 2 | 2026-01-02 |
| 3 | 2026-01-04 |
| 4 | 2026-01-05 |
| 5 | 2026-01-07 |
| task_id(INTEGER) | task_name(VARCHAR) |
|---|---|
| 1 | Backups |
| id(INTEGER) | max_gap(INTEGER) |
|---|---|
| 1 | 0 |
| batch_id(INTEGER) | start_date(DATE) | end_date(DATE) |
|---|---|---|
| 1 | 2026-01-01 | 2026-01-02 |
| 2 | 2026-01-04 | 2026-01-05 |
| 3 | 2026-01-07 | 2026-01-07 |