-
Notifications
You must be signed in to change notification settings - Fork 313
Description
SQLMesh version: 0.224.0
Dialect: Databricks
Despite using WITH RECURSIVE, SQLMesh/SQLGlot still treats the CTE name as an external model.
Model:
MODEL (
name silver.test_recursive_cte,
kind FULL,
cron "@daily"
);
WITH RECURSIVE number_series (n) AS (
SELECT 1 AS n
UNION ALL
SELECT n + 1 FROM number_series WHERE n < 10
)
SELECT n AS number_value FROM number_series;Error:
sqlmesh plan
Error: [TABLE_OR_VIEW_NOT_FOUND] The table or view number_series cannot be found. Verify the
spelling and correctness of the schema and catalog.
If you did not qualify the name with a schema, verify the current_schema() output, or
qualify the name with the correct schema and catalog.
To tolerate the error on drop use DROP VIEW IF EXISTS or DROP TABLE IF EXISTS. SQLSTATE:
42P01; line 1 pos 350