Skip to content

fix(runtime): terminate fill-missing time spines for unaligned bounds - #9835

Open
eminemead wants to merge 1 commit into
rilldata:mainfrom
eminemead:xiaofei.yin/fix-time-spine-termination
Open

fix(runtime): terminate fill-missing time spines for unaligned bounds#9835
eminemead wants to merge 1 commit into
rilldata:mainfrom
eminemead:xiaofei.yin/fix-time-spine-termination

Conversation

@eminemead

@eminemead eminemead commented Aug 26, 2026

Copy link
Copy Markdown
  • SelectTimeRangeBins in the starrocks, clickhouse, pinot, druid, and snowflake dialects looped forever when the truncated start never equalled an unaligned end (t != end), allocating unbounded SQL until the process was OOM-killed.
  • A shared timeutil.TimeRangeBins now truncates the start, iterates half-open with t.Before(end), and errors above 1500 actual bins. Those dialects only format that slice.
  • DuckDB / BigQuery / Databricks native-SQL paths are unchanged; the ApproximateBins pre-check in ast.go stays as a fast-fail.
  • Live-verified on an unaligned UTC day fillMissing request: HTTP 200 in under a second with flat memory (previously hung until timeout while resident memory grew to tens of GB).

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

Developed in collaboration with Claude Code

Generate a finite half-open bin list in timeutil, hard-capped at 1500, so looping OLAP dialects cannot hang or allocate unbounded SQL when start and end are not grain-aligned.
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.

2 participants