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] Redshift sql_header, doesn't work, but doesn't error either #9819

Closed
2 tasks done
ann8ty opened this issue Mar 25, 2024 · 4 comments
Closed
2 tasks done

[Bug] Redshift sql_header, doesn't work, but doesn't error either #9819

ann8ty opened this issue Mar 25, 2024 · 4 comments
Labels
bug Something isn't working stale Issues that have gone stale

Comments

@ann8ty
Copy link

ann8ty commented Mar 25, 2024

Is this a new bug in dbt-core?

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

Current Behavior

Per doc https://docs.getdbt.com/reference/resource-configs/sql_header I've tried both:

models:
  +sql_header: "SET enable_case_sensitive_super_attribute to TRUE;"
{{ config(
    sql_header = "SET enable_case_sensitive_super_attribute to TRUE;")}}

we've also tried ON instead of TRUE

and the result is the column value is NULL when run through DBT, but the same query run through redshift query editor produces a value, leading us to believe that enable_case_sensitive_super_attribute isn't being set by DBT.

this is a per session attribute in redshift, unable to set as a parameter group

the rest of the dbt staging sql

with i_json as (
SELECT
    JSON_PARSE(inv) as i_super,
FROM {{ source('dynamodb_raw', 'table_status' )}} t )
select
    i."isNet" as is_net,
from i_json t, t.i_super i

Expected Behavior

expected DBT to work the same as redshift query editor

Steps To Reproduce

  1. dbt run
  2. look at output, its null
  3. same query in redshift query editor, has value

Relevant log output

"completed successfully"

Environment

- OS: mac os sonoma 14.4 (23E214)
- Python: Python 3.12.2
- dbt: 1.4.7

Which database adapter are you using with dbt?

redshift

Additional Context

is it possibly not sql_header for redshift? there is no example for redshift.

@ann8ty ann8ty added bug Something isn't working triage labels Mar 25, 2024
@graciegoheen
Copy link
Contributor

Hi! Trying to figure out what might be going on here. You mentioned "this is a per session attribute in redshift". I wonder if we're sending the statements to the database in a way that each statement becomes its own session. Would you be able to try it on 1.5, which uses redshift-connector instead of psycopg2 and see if the behavior is any different?

Copy link
Contributor

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.

@github-actions github-actions bot added the stale Issues that have gone stale label Jun 26, 2024
Copy link
Contributor

github-actions bot commented Jul 3, 2024

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.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 3, 2024
@cgilling
Copy link

I just wanted to comment that I just tested this with dbt-redshift version 1.9 and it does indeed work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Issues that have gone stale
Projects
None yet
Development

No branches or pull requests

4 participants