Repository navigation
fix(query): don't panic on out-of-range timestamp literals - #64
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
extract_timestamp_bound(src/query/stream_schema_provider.rs) calledDateTime::from_timestamp_millis(v).unwrap(). Any SQL query whose millisecond timestamp literal is outside chrono's range panics the query worker during planning: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 reportedInexact, contributes no manifest-pruning bound, and DataFusion evaluates it normally. The nanosecond arm already uses chrono's infalliblefrom_timestamp_nanos.Tests
out_of_range_millisecond_literal_yields_no_bound: unit test onextract_timestamp_bound/expr_in_boundary.out_of_range_millisecond_literal_in_sql_does_not_panic: plans the SQL above through aSessionContext.Both panic on
mainand pass with the fix.cargo fmt --checkis clean,cargo testpasses (851 passed), andcargo clippy --all-targetsreports nothing new in the changed file.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.