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] Ghost record generation produces invalid code when satellite hashdiff has an alias #173

Closed
mjahammel opened this issue Dec 19, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@mjahammel
Copy link

Describe the bug
When the hashdiff column for a satellite is specified with an alias, the ghost record generation fails with an error like so:

16:48:36  Database Error in model sat_ovtn_member_pii (models/raw_vault/satellites/sat_ovtn_member_pii.sql)
16:48:36    000904 (42000): SQL compilation error: error line 62 at position 33
16:48:36    invalid identifier 'G.DV_HASHDIFF_SAT_OVTN_MEMBER_PII'

Examining the generated code shows that the 'ghost' CTE has not included the hashdiff column, resulting in the error.

Versions
dbt: 1.3.0
dbtvault: 0.9.1
Target: Snowflake

To Reproduce
Steps to reproduce the behavior:

  1. Set up hashdiff column with alias in the satellite definition:
src_hashdiff:
  source_column: DV_HASHDIFF_SAT_OVTN_MEMBER_PII
  alias: DV_HASHDIFF
  1. Add the variables to generate the ghost record in dbt_project.yml:
enable_ghost_records: true
system_record_value: "GHOST"
  1. Run dbt to generate the satellite
  2. See error

Expected behavior
The satellite should be created with a ghost record included.

@mjahammel mjahammel added the bug Something isn't working label Dec 19, 2022
@chrispuuri
Copy link

We ran into this one as well. This is a deal breaker from us using this feature at the moment.

@DVAlexHiggs
Copy link
Member

We ran into this one as well. This is a deal breaker from us using this feature at the moment.

Hotfix on its way!

@chrispuuri
Copy link

chrispuuri commented Dec 22, 2022 via email

@DVAlexHiggs
Copy link
Member

Released v0.9.2, this should be fixed :) Please re-open if you continue to have the same issue, or open a new issue if you experience any new issues. Thank you for this report!

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

No branches or pull requests

3 participants