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 problem with timestamp data types for load_datetime and effective_from columns #174

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

Comments

@mjahammel
Copy link

Describe the bug
When the target is Snowflake, if the staging view uses the datatype TIMESTAMP_TZ for the load_datetime and effective_from columns, then the ghost record generation fails with the following error:

17:00:24    001790 (42601): SQL compilation error:
17:00:24    inconsistent data type for result columns for set operator input branches, expected TIMESTAMP_TZ(9), got TIMESTAMP_NTZ(9) for expression [{2}] branch {3}

Versions
dbt: 1.3.0
dbtvault: 0.9.1
target: Snowflake

To Reproduce
Steps to reproduce the behavior:

  1. Set up staging view in such a way that either the load_datetime and/or the effective_from columns have the datatype TIMESTAMP_TZ
  2. Set up a satellite to automatically generate the ghost record
  3. Run dbt to create the satellite table.
  4. See error

Expected behavior
A satellite table should be created with a ghost record.

A work-around for now is to change the timestamp in the staging view to TIMESTAMP_NTZ.

@mjahammel mjahammel added the bug Something isn't working label Dec 19, 2022
DVAlexHiggs added a commit that referenced this issue Dec 22, 2022
* Test passing for ghost record with hashdiff alias

* Add unit test for ghost record + hashdiff alias

Also move ghost record tests to correct folder

* Fix sat macro unit test failures

* Initial split of macro for cast_date and datetime

Re-produced  #174

* TZ Test now passing for Snowflake

* Running on SQLServer, Postgres, BQ

* Fix SQLServer fixture

* Fix for postgres
@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

2 participants