Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] <dbt run --empty is not working with nested columns spectrum> #900

Closed
2 tasks done
gekas93 opened this issue Aug 30, 2024 · 0 comments
Closed
2 tasks done

[Bug] <dbt run --empty is not working with nested columns spectrum> #900

gekas93 opened this issue Aug 30, 2024 · 0 comments
Labels
bug Something isn't working triage

Comments

@gekas93
Copy link

gekas93 commented Aug 30, 2024

Is this a new bug in dbt-redshift?

  • I believe this is a new bug in dbt-redshift
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

Running dbt run --empty , we get a spectrum nested query error.

Database Error in model base_***** (models/base/*****/base_*****.sql)
  Spectrum nested query error

The compiled code is the following:

  create  table
    "DATABASE"."SCHEMA"."base_*****__dbt_tmp"
  as (
    select *
from
    (select * from "DATABASE"."SCHEMA"."TABLE" where false limit 0)
  );

If we remove the limit 0 or we remove the subquery having something like this:

  create  table
    "DATABASE"."SCHEMA"."base_*****__dbt_tmp"
  as (
    select * from "DATABASE"."SCHEMA"."TABLE" where false limit 0
  );

The query works on redshift.

Expected Behavior

dbt run --empty works on redshift spectrum.

Steps To Reproduce

  1. To have some spectrum source with array column.
  2. Create some model with select * to that source.
  3. Run dbt run --empty

Relevant log output

No response

Environment

- OS: Mac
- Python:3.9.18
- dbt-core:1.8.1
- dbt-redshift:1.8.1

Additional Context

No response

@gekas93 gekas93 added bug Something isn't working triage labels Aug 30, 2024
@gekas93 gekas93 closed this as completed Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

1 participant