Skip to content

fix(query): don't panic on out-of-range timestamp literals - #64

Merged
VibeSWE merged 1 commit into
mainfrom
fix/timestamp-literal-overflow-panic
Oct 24, 2026
Merged

VibeSWE merged 1 commit into
mainfrom
fix/timestamp-literal-overflow-panic

Conversation

@VibeSWE

@VibeSWE VibeSWE commented Oct 24, 2026 •

Copy link
Copy Markdown

Problem

extract_timestamp_bound (src/query/stream_schema_provider.rs) called DateTime::from_timestamp_millis(v).unwrap(). Any SQL query whose millisecond timestamp literal is outside chrono's range panics the query worker during planning:

SELECT * FROM logs WHERE p_timestamp >= to_timestamp_millis(9223372036854775807)

The panic happens in supports_filters_pushdown → expr_in_boundary, so it is reachable on every stream regardless of the manifest-pruning column checks.

Found while reviewing #63 (a GPT-6.1 Sol review subagent reproduced it); independent of that PR.

Fix

Return None (no time bound) when the literal can't be represented. The filter is then reported Inexact, contributes no manifest-pruning bound, and DataFusion evaluates it normally. The nanosecond arm already uses chrono's infallible from_timestamp_nanos.

Tests

  • out_of_range_millisecond_literal_yields_no_bound: unit test on extract_timestamp_bound / expr_in_boundary.
  • out_of_range_millisecond_literal_in_sql_does_not_panic: plans the SQL above through a SessionContext.

Both panic on main and pass with the fix. cargo fmt --check is clean, cargo test passes (851 passed), and cargo clippy --all-targets reports nothing new in the changed file.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

extract_timestamp_bound unwrapped DateTime::from_timestamp_millis, so a
query such as `p_timestamp >= to_timestamp_millis(9223372036854775807)`
panicked the query worker during filter-pushdown negotiation
(supports_filters_pushdown -> expr_in_boundary). Treat a literal chrono
can't represent as "no bound": the filter is then Inexact and evaluated
normally by DataFusion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant