You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be really helpful to have more explicit errors on single quote usage (string literals) in sql models, as the arising errors from misuse are very confusing.
Case 1
I had 2 sql models defined, one as
MODEL (
name sqlmesh_example.runescape_mapping,
...
and the other as
MODEL (
name 'sqlmesh_example.hourly_scrape'
...
and was getting the error
❯ uv run sqlmesh plan dev
2024-12-13 12:08:32,038 - MainThread - sqlmesh.core.loader - ERROR - SQLMesh requires all model names and references to have the same level of nesting. (loader.py:634)
Error: Table "db"."sqlmesh_example"."runescape_mapping" must match the schema's nesting level: 1.
The issue was the single quotes breaking the schema's nest level (one dot) but that was really difficult to debug
with the time column defined in single quotes. On running, I was getting the error
duckdb.duckdb.ConversionException: Conversion Error: timestamp field value out of range: "ts", expected format is (YYYY-MM-DD
HH:MM:SS[.US][±HH:MM| ZONE])
LINE 1: ...ample__hourly_scrape__189843799" where 'ts' >= TIMESTAMP '2024-12-12 00:00:00+...
I changed the model kind to FULL and stopped getting the error, but it was unclear that the issue was simply that the timestamp column was literally 'ts'.
Thank you!
The text was updated successfully, but these errors were encountered:
Coming out of this discussion: https://tobiko-data.slack.com/archives/C044BRE5W4S/p1734109818343679
It would be really helpful to have more explicit errors on single quote usage (string literals) in sql models, as the arising errors from misuse are very confusing.
Case 1
I had 2 sql models defined, one as
and the other as
and was getting the error
The issue was the single quotes breaking the schema's nest level (one dot) but that was really difficult to debug
Use case 2
In that model, the
kind
was defined aswith the time column defined in single quotes. On running, I was getting the error
I changed the model kind to
FULL
and stopped getting the error, but it was unclear that the issue was simply that the timestamp column was literally'ts'
.Thank you!
The text was updated successfully, but these errors were encountered: