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

if customized schema is used the redshift macro writes the admin views in the wrong schema #39

Open
4 tasks
misteliy opened this issue Nov 5, 2020 · 1 comment
Labels

Comments

@misteliy
Copy link

misteliy commented Nov 5, 2020

Describe the bug

If we use:
{{
config({
"materialized":"table",
"schema": "raw",
"sort": "load_dts",
"dist": "all",
"comprows": 1000,
"post-hook": [
"{{ redshift.compress_table(this.schema, this.table, drop_backup=True) }}"
]
})
}}

the schema field is not getting picked up by the redshift.compress_table expression and hence writing to the wrong schema

Steps to reproduce

Please use provided config for a model

Expected results

should use the same schema as passed in the config clause

Actual results

using the default schema as provided in the profiles.yml

Screenshots and log output

If applicable, add screenshots or log output to help explain your problem.

System information

The contents of your packages.yml file:

Which database are you using dbt with?

  • postgres
  • [x ] redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

<output goes here>

The operating system you're using:

The output of python --version:

Additional context

@misteliy misteliy added the bug label Nov 5, 2020
@jtcohen6
Copy link
Contributor

Hey @misteliy, I haven't been able to replicate this (using dbt v0.18.1 and redshift package v0.4.1). The model builds in the correct schema, and then uses the compress_table macro to check for recommendations on the proper table.

Can you confirm that the model is building to a schema suffixed _raw? By any chance, do you have a generate_schema_name macro defined in your project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants