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 get a Database Error when I use the --empty argument on a model that uses table aliases.
Expected Behavior
I expect dbt to materialize the empty model.
Steps To Reproduce
Create a model my_model. Alias the referenced model.
SELECT e.*FROM {{ source("atomic", "events") }} e
Run dbt with the --empty argument.
dbt --debug run --select my_model --empty
I get the same error if I add AS in front of the alias name.
Relevant log output
10:25:16 On model.snowplow.my_model: /* {"app": "dbt", "dbt_version": "1.8.0", "profile_name": "studyportals", "target_name": "staging", "node_id": "model.snowplow.my_model"} */
create view studyportals.dbt_test.my_model__dbt_tmp as (
SELECT e.*
FROM (select * from studyportals.atomic.events where false limit 0) _dbt_limit_subq_events e
) with no schema binding;
10:25:16 Redshift adapter: Redshift error: syntax error at or near "e"
10:25:16 On model.snowplow.my_model: ROLLBACK
10:25:16 On model.snowplow.my_model: Close
10:25:16 Database Error in model my_model (models\my_model.sql)
syntax error at or near "e"
compiled Code at target\run\snowplow\models\my_model.sql
Environment
- OS: Windows
- Python: 3.10.11
- dbt: 1.8.0
Which database adapter are you using with dbt?
redshift
Additional Context
No response
The text was updated successfully, but these errors were encountered:
It looks like that PR was merged to main but wasn't backported to 1.8.latestfor inclusion in v1.8.0. As soon as we merge that backport and include it in adbt-redshift` patch release, I hope this will start working for you:
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.
Is this a new bug in dbt-core?
Current Behavior
I get a Database Error when I use the
--empty
argument on a model that uses table aliases.Expected Behavior
I expect dbt to materialize the empty model.
Steps To Reproduce
Create a model
my_model
. Alias the referenced model.Run dbt with the
--empty
argument.I get the same error if I add
AS
in front of the alias name.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: