Repository navigation
A Snowflake date or timestamp reads as a date, so 18262 is 2020-01-01 - #1412
Merged
Merged
Conversation
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
WaylandYang
requested changes
Oct 25, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Looks good. Like the other Snowflake tests, this checks our reading of the documented protocol, not a real cluster (#241). Please add a sentence to ADR 0018's fourth-gate paragraph saying dates and timestamps are now restored.
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
WaylandYang
approved these changes
Oct 27, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thanks, the ADR sentence is exactly what was needed. Approving and merging.
2 tasks done
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.
Why
The Snowflake SQL API returns each value as a string, and temporal types are encoded as epoch numbers (SQL API: getting the results):
DATEis the number of days since the epoch:"18262".TIME,TIMESTAMP_NTZandTIMESTAMP_LTZare seconds with nine decimals:"1616173619.000000000".TIMESTAMP_TZis seconds, a space, then 1440 plus the zone offset in minutes:"1616173619.000000000 1500".The engine passed these strings through
coerce, which only restores numbers and booleans. A query such asSELECT order_date, SUM(amount) … GROUP BY 1gave the model"18262"where the warehouse holds2020-01-01. The model has no way to read that as a date, so date questions against Snowflake were answered from opaque numbers.What changes
A Snowflake-only
cellruns beforecoerce. It writes:dateas2020-01-01;timeas23:01:59;timestamp_ntzas2021-03-19 17:06:59;timestamp_ltzas RFC 3339 UTC,2021-03-19T17:06:59Z;timestamp_tzas RFC 3339 with its own offset,2021-03-19T18:06:59+01:00.Fractions are kept, for example
.500. Times before 1970 floor correctly, so-1.5seconds is1969-12-31 23:59:58.500. A value that does not parse is left as it came. Every other type still goes throughcoerce, and both the first partition and later partitions use the new function.How it was checked
dates_and_times_read_as_dates_and_times, returns two rows typeddate,time,timestamp_ntz,timestamp_ltzandtimestamp_tz. They cover a pre-1970 instant, a null, and offsets of +01:00 and -06:00.cargo test -p utopia-server --bins query_engine::snowflake: 10 passed.left: ["{\"D\":\"18262\",\"T\":\"82919.000000000\",\"NTZ\":\"1616173619.000000000\",….cargo fmt --all --checkandcargo clippy -p utopia-server --all-targets -- -D warningspass.Before review
git commit -s)cargo fmt --all --check,cargo clippyandcargo testpass for the touched crateRequested ADR follow-up
Updated ADR 0018 as requested in review. This appended revision changes documentation only; Rust and Cargo files are byte-for-byte unchanged from the prior public head.
cargo fmt --all --checkandgit diff --checkpass. No new Rust test run or live-cluster acceptance is claimed for this revision. Final-head CI remains required.