Repository navigation
Conversation
COALESCE(MAX(updated_at), '1900-01-01') is the incremental high-water mark idiom. A string literal beside a TIMESTAMP_NTZ(9) branch in COALESCE, IFNULL, NVL, IFF or CASE is now read as the timestamp it spells, checked when converting: text outside DuckDB's nanosecond range or in an unproven form still refuses.
…side dates Staging models filter with occurred_at >= DATEADD(day, -3, CURRENT_TIMESTAMP()) and BETWEEN DATEADD(day, -7, CURRENT_DATE()) AND CURRENT_DATE(). DATEADD and DATEDIFF of a TIMESTAMP_LTZ now compute on its UTC wall time, relying on session_timezone_utc. A TIMESTAMP_NTZ compared with a DATE reads the DATE as its midnight, and compared with a TIMESTAMP_LTZ reads it at its UTC wall time.
Snowflake results for the five cases in cases/conditional/text_literal_timestamps.toml and cases/temporal/naive_beside_local.toml at 8b779bd.
…d with a naive timestamp The comparison now converts, reading the TIMESTAMP_LTZ at its UTC wall time, so the case's nanosecond value raises the declared guard like the other zoned comparisons of that column.
Five new recorded statements now match, two existing cases move from refused to matching, and the LTZ-equals-NTZ comparison becomes a declared divergence. Nothing regressed.
Snowflake results for the two cases in cases/temporal/timestamp_text_digits.toml at 0d86922.
…qlstack-io/sqlquack into fix/incremental-idioms
…iting it as text The recorded receipts show Snowflake truncates TIMESTAMP_NTZ(9) text to milliseconds and never rounds or carries, through TO_VARCHAR and casts alike. The runtime guard that raised where truncating and rounding differ, and its timestamp_text_rounding divergence, are removed; the cases that expected it now compare values.
Three timestamp-to-text cases that declared timestamp_text_rounding now match, and the two new receipt cases match. Nothing regressed.
Contributor
Author
|
Gate (D94) on 1f78b8f, which is 8190cd7 merged with main 0f0a26a:
|
Contributor
Author
|
Closing: SQLQuack lands through local-gate trains, not PR merges (D94), so open PRs only add clutter (D628/D630). The branch is kept. Any work here that isn't on main yet is tracked by the train owner and lands through a train. |
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
Incremental models commonly filter with idioms that SQLQuack refused: a TIMESTAMP_NTZ column compared with a DATE or with CURRENT_TIMESTAMP(), DATEADD/DATEDIFF over CURRENT_TIMESTAMP(), and COALESCE(MAX(ts), '1900-01-01') or a '9999-12-31' sentinel beside a timestamp.
Changes
Verification
make check-mergeruns on the exact head before landing.