From 4bc0ea0af35f4b29bbd66cc278a64f29c4fecb12 Mon Sep 17 00:00:00 2001 From: "Lennart Kats (databricks)" Date: Tue, 4 Jun 2024 17:40:40 +0200 Subject: [PATCH] Fix SQL schema selection in default-sql template (#1471) ## Changes This fixes a last-minute regression that snuck into https://github.com/databricks/cli/pull/1463: unfortunately we need to use `USE IDENTIFIER('schema')` to select a schema for now. In the future we expect we can just use `USE SCHEMA 'schema'`. --- .../template/{{.project_name}}/src/orders_daily.sql.tmpl | 2 +- .../template/{{.project_name}}/src/orders_raw.sql.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/template/templates/default-sql/template/{{.project_name}}/src/orders_daily.sql.tmpl b/libs/template/templates/default-sql/template/{{.project_name}}/src/orders_daily.sql.tmpl index 870fe9c0b8..7c86f92121 100644 --- a/libs/template/templates/default-sql/template/{{.project_name}}/src/orders_daily.sql.tmpl +++ b/libs/template/templates/default-sql/template/{{.project_name}}/src/orders_daily.sql.tmpl @@ -2,7 +2,7 @@ {{- /* We can't use a materialized view here since they don't support 'create or refresh' yet.*/}} USE CATALOG {{"{{"}}catalog{{"}}"}}; -USE {{"{{"}}schema{{"}}"}}; +USE IDENTIFIER({{"{{"}}schema{{"}}"}}); CREATE OR REPLACE VIEW orders_daily diff --git a/libs/template/templates/default-sql/template/{{.project_name}}/src/orders_raw.sql.tmpl b/libs/template/templates/default-sql/template/{{.project_name}}/src/orders_raw.sql.tmpl index d5891895a7..c73606ef1a 100644 --- a/libs/template/templates/default-sql/template/{{.project_name}}/src/orders_raw.sql.tmpl +++ b/libs/template/templates/default-sql/template/{{.project_name}}/src/orders_raw.sql.tmpl @@ -4,7 +4,7 @@ -- See also https://docs.databricks.com/sql/language-manual/sql-ref-syntax-ddl-create-streaming-table.html USE CATALOG {{"{{"}}catalog{{"}}"}}; -USE {{"{{"}}schema{{"}}"}}; +USE IDENTIFIER({{"{{"}}schema{{"}}"}}); CREATE OR REFRESH STREAMING TABLE orders_raw