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 got a syntax error when I ran dbt run on an incremental table. After spending some time debugging, I identified the source of the error. My sql file had an line comment at the end of the last line of my select statement. This caused the incremental table logic to fail.
Results
I expected my incremental table update to succeed. Instead, I got a syntax error.
The error message looked like
syntax error at or near "where"
where (updated_at >= (select max(t.updated_at) from...
System information
The output of dbt --version:
~: dbt --version
installed version: 0.11.1
latest version: 0.11.1
Up to date!
The operating system you're running on: macOS Sierra Version 10.12.4
The python version you're using (probably the output of python --version): Python 3.6.5
Steps to reproduce
I have a .sql file that defines my incremental table that looks like this
{{
config({
"materialized" : "incremental",
"sql_where" : "updated_at > (select max(updated_at) from {{ this }})",
"unique_key": "id"
})
}}
select ...
from table
where a = b -- This is a comment
If you try to run this table, look at the debugging output. It will look something like
create temporary table
"xxx__dbt_incremental_tmp"
as (
select * from (
select ...
from table
where a = b -- This is a comment) as dbt_incr_sbq
where updated_at > (select max(updated_at) from {{ this }})
);
However, because of the comment on the last line of my model, the ) as dbt_incr_sbq is ignored. And this causes the syntax error.
The text was updated successfully, but these errors were encountered:
Hey @mfrasco6 - thanks for the report! This is a dupe of #1018 which was fixed in #1019. This change will be going out in our next release of dbt, v0.12.0! Apologies for the trouble :)
Issue
Issue description
I got a syntax error when I ran
dbt run
on an incremental table. After spending some time debugging, I identified the source of the error. My sql file had an line comment at the end of the last line of my select statement. This caused the incremental table logic to fail.Results
I expected my incremental table update to succeed. Instead, I got a syntax error.
The error message looked like
System information
The output of
dbt --version
:The operating system you're running on: macOS Sierra Version 10.12.4
The python version you're using (probably the output of
python --version
): Python 3.6.5Steps to reproduce
I have a .sql file that defines my incremental table that looks like this
If you try to run this table, look at the debugging output. It will look something like
However, because of the comment on the last line of my model, the
) as dbt_incr_sbq
is ignored. And this causes the syntax error.The text was updated successfully, but these errors were encountered: