Repository navigation
Conversation
Contributor
|
Preview root: https://posit-dev.github.io/commons/pr-444/ Python site preview: https://posit-dev.github.io/commons/pr-444/py/ Built from the latest commit on this branch. The R links in it point at the published R site, which no pull request rebuilds. |
The checker accepts an untyped NULL as a temporal shift's interval and types the result as a datetime, but the emitters rewrote a shift only when an operand had the interval type. created + NULL therefore fell through to a plain +, and Snowflake refuses to add a bare NULL to a DATE. Both emitters now write a NULL cast to the dialect's timestamp type. The shared warehouse fixture pins the corpus's nullable date shift for both targets. Closes #441
jat255
force-pushed
the
jat255/438-quote-lowercase-tables
branch
from
October 22, 2026 02:46
d41e26b to
af62e71
Compare
jat255
force-pushed
the
jat255/441-typed-null-date-shift
branch
from
October 22, 2026 02:46
521853f to
4e4c282
Compare
This branch has not been deployed
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.
Closes #441
This PR makes a definition such as
created + NULLcompile to a typedNULLtimestamp on Snowflake and Databricks. Snowflake refuses to add a bareNULLto aDATE.Details (agent-written)
The type checker reads
created + NULLas a temporal shift with adatetimeresult, but the emitters rewrote a shift only when an operand had theintervaltype. Both the Python emitter and the R emitter now writeCAST(NULL AS TIMESTAMP_TZ)on Snowflake andCAST(NULL AS TIMESTAMP)on Databricks. These are the types the live fixture uses for timestamp columns. The shared warehouse fixture pins both.Known gap: a sibling definition whose value is
NULL, used as the shift, still compiles toDATE + (NULL)after composition. The emitter sees only a reference with the typeany, and ananyoperand can also be an untyped column with real values, so it cannot be typedNULLthe way a literal can. This is tracked as kata y8nf.Testing: the full Python and R suites pass. On live Snowflake, with this whole stack, all 40 corpus definitions return the same values as DuckDB, and every Snowflake live test passes in both packages. Databricks is not verified.
Kata: whhh, y8nf.
R changes
The R SQL emitter now compiles a date or datetime shifted by a literal
NULLto aNULLcast to the dialect's timestamp type (definition-emit-sql.R). Snowflake used to reject the compiled SQL for such a definition, and now runs it and returnsNULL. Every other temporal shift compiles as before. NEWS has a bullet.