-
Notifications
You must be signed in to change notification settings - Fork 22
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
add custom greenplum__snapshot_staging_table
to support snapshots
#29
Comments
Did implementing it solved this on your side ?
|
Hi 👋 I think it's that in the long CTE dbt v1.5.9 generates for running How did I get myself to this issue? I'm having the same problem as the core issues 1665 and 3064 that Anders mentioned. Apparently, spinning up a postgres database in cPanel v110.0.23 gets me this version of postgres: Which I think means it's better to address upstream then in only the Greenplum adapter? Or could someone tell me where the current version of the snapshot code is hiding? https://github.com/dbt-labs/dbt-core/blob/38f278cce0a5ccd2f92cc3381f3f0d02d30babe8/core/dbt/include/global_project/macros/materializations/snapshot/snapshot.sql#L142 is referenced in 3064 but that file doesn't exist under the 1.5.9 version tag. If it's a macro I can try over-writing it. If it's not over-ride-able then dbt Cloud still can't run snapshots on Postgres 9(which is totally legit to say is a me problem). (As I was spelunking for a place to override with this change I saw the words postgres and index together and remembered that you actually are NOT supposed to put indexes on Greenplum tables. I know, I know, 🤨 "you have to be joking", but true. Even if you think it's working, just say no.) |
I managed to solve the issue by applying the fix suggested by @dataders and subsequently modifying the snapshot_merge.sql file located here to the following
This should resolve the recursion issue. |
@dataders , @b00033811 So I am pretty new to dbt and I'm stuck with the same problem. Can you please explain how to fix it? I have
should I just upgrade both for problem to go away? thanks in advance! |
snapshots fail on greenplum because it relies on an older version of postgres. equivalent issues for dbt-postgres: dbt-labs/dbt-core#1665 dbt-labs/dbt-core#3064
the answer is to do as suggested in above issues and add a new macro
greenplum__snapshot_staging_table()
that is exactly the same asdefault__snapshot_staging_table
, but the type casting on 3 lines changes.The text was updated successfully, but these errors were encountered: