Skip to content

feat/cq-calendar-month-intervals - #18547

Open
DaZuiZui wants to merge 19 commits into
apache:masterfrom
DaZuiZui:feat/cq-calendar-month-intervals
Open

feat/cq-calendar-month-intervals#18547
DaZuiZui wants to merge 19 commits into
apache:masterfrom
DaZuiZui:feat/cq-calendar-month-intervals

Conversation

@DaZuiZui

@DaZuiZui DaZuiZui commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Implementation

This change adds calendar-aware mo and y durations to Continuous Query EVERY and RANGE clauses.

  • Parse CQ durations into structured (monthPart, nonMonthDuration) values instead of flattening calendar units into fixed milliseconds.
  • Preserve structured durations when they are inherited from GROUP BY TIME.
  • Calculate CQ occurrences and RANGE boundaries from the original boundary in the persisted CQ time zone, applying calendar months first and fixed-duration components afterward.
  • Handle month-end clamping, leap years, DST transitions, omitted boundaries, and mixed calendar/fixed durations.
  • Add versioned structured duration fields to TCreateCQReq, while retaining legacy fixed-duration fields and compatibility handling for existing requests and snapshots.
  • Persist calendar-aware CQ metadata, boundary information, time zone, and occurrence progress across restart, leader recovery, and snapshot recovery.
  • Advance CQ progress using token/index validation so stale or duplicated callbacks cannot create competing schedules.
  • Calculate execution timeouts from the actual distance between adjacent calendar occurrences.
  • Add checked duration parsing/arithmetic, semantic validation, i18n messages, and focused tests for parsing, scheduling, persistence, recovery, and compatibility.

Fixes #18428

@DaZuiZui DaZuiZui changed the title feat: support calendar month and year CQ intervals feat/cq-calendar-month-intervals Aug 31, 2026
@DaZuiZui
DaZuiZui force-pushed the feat/cq-calendar-month-intervals branch from 2e70ead to b81d179 Compare September 4, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support calendar-month/year (mo/y) intervals for Continuous Query EVERY and RANGE clauses

1 participant