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
I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
I have a complex view that has a string with an escaped '\' and then another string with a simicolon ';'.
It compiles fine and the created SQL looks fine, but when dbt run on that model it fails with the following error.
18:56:58 Running with dbt=1.9.2
18:56:58 Registered adapter: redshift=1.9.0
18:56:58 Unable to do partial parsing because saved manifest not found. Starting full parse.
18:56:59 Found 1 model, 502 macros
18:56:59
18:56:59 Concurrency: 1 threads (target='dev')
18:56:59
18:57:04 1 of 1 START sql view model public_public.temp ................................. [RUN]
18:57:05 1 of 1 ERROR creating sql view model public_public.temp ........................ [ERROR in 0.97s]
18:57:05
18:57:05 Finished running 1 view model in 0 hours 0 minutes and 6.02 seconds (6.02s).
18:57:05
18:57:05 Completed with 1 error, 0 partial successes, and 0 warnings:
18:57:05
18:57:05 Database Error in model temp (models/example/temp.sql)
unterminated quoted string at or near "'x;" in context "t NOT IN ('x;", at line 36, column 25
compiled code at target/run/test/models/example/temp.sql
in the logs I can see that the query being sent ends at the semicolon... but if I take the code that is generated from the compile step and wrap it in the create view create view "dwh"."public_public"."temp__dbt_tmp" as ( <OUTPUT> ) it runs fine in redshift... so I have to assume that dbt is not sending the full query to redshift.
Expected Behavior
Since the view compiles fine I just expected that the view should be created just fine.
Steps To Reproduce
created brand new dbt env (installed dbt-code and dbt-redshift)
then ran the dbt init command
then copied the following temp.sql file into the models folder
temp.sql
{{ config(materialized='view') }}
WITH x AS (
SELECT
CASE
WHEN TRUE
THEN NULL
END AS x,
CASE
WHEN TRUE
THEN NULL
END AS y,
CASE
WHEN TRUE
THEN NULL
END AS z,
CASE
WHEN TRUE
THEN ''
END AS t
),
y AS (
SELECT
(
SELECT ''
FROM x
WHERE t NOT IN ('v\\')
) AS z,
(
SELECT ''
FROM x
WHERE t NOT IN ('x;x')
) AS d
FROM x
)
SELECT *
FROM y
nothing custom
dbt run --select temp
Relevant log output
�[0m12:57:04.869019 [debug] [Thread-1 (]: Using redshift connection "model.test.temp"
�[0m12:57:04.869295 [debug] [Thread-1 (]: On model.test.temp: /* {"app": "dbt", "dbt_version": "1.9.2", "profile_name": "test", "target_name": "dev", "node_id": "model.test.temp"} */
create view "dwh"."public_public"."temp__dbt_tmp" as (
WITH x AS (
SELECT
CASE
WHEN TRUE
THEN NULL
END AS x,
CASE
WHEN TRUE
THEN NULL
END AS y,
CASE
WHEN TRUE
THEN NULL
END AS z,
CASE
WHEN TRUE
THEN ''
END AS t
),
y AS (
SELECT
(
SELECT ''
FROM x
WHERE t NOT IN ('v\\')
) AS z,
(
SELECT ''
FROM x
WHERE t NOT IN ('x;�[0m12:57:04.970751 [debug] [Thread-1 (]: Redshift adapter: Redshift error: unterminated quoted string at or near "'x;" in context "t NOT IN ('x;", at line 36, column 25�[0m12:57:04.971205 [debug] [Thread-1 (]: On model.test.temp: ROLLBACK
Environment
- OS:
- Python: 3.11.11
- dbt: 1.9.2
Which database adapter are you using with dbt?
redshift
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Is this a new bug in dbt-core?
Current Behavior
I have a complex view that has a string with an escaped '\' and then another string with a simicolon ';'.
It compiles fine and the created SQL looks fine, but when
dbt run
on that model it fails with the following error.in the logs I can see that the query being sent ends at the semicolon... but if I take the code that is generated from the compile step and wrap it in the create view
create view "dwh"."public_public"."temp__dbt_tmp" as ( <OUTPUT> )
it runs fine in redshift... so I have to assume that dbt is not sending the full query to redshift.Expected Behavior
Since the view compiles fine I just expected that the view should be created just fine.
Steps To Reproduce
then ran the dbt init command
then copied the following temp.sql file into the models folder
temp.sql
Relevant log output
Environment
Which database adapter are you using with dbt?
redshift
Additional Context
No response
The text was updated successfully, but these errors were encountered: