dbt snapshot fails

Hi,
I get snapshop datatypes error
Value has type STRUCT<module STRING, reference_entity_class STRING, reference_table STRING, ...> which cannot be inserted into column created_by, which has type STRUCT<module STRING, reference_entity_class STRING, reference_table STRING, ...> at [16:33]
the problematic column is a struct and there were new fields/subcolumns added. Does this mean snapshots cannot account for schema changes in nested columns, or am i missing something?
Thank you so much in advance!
Attached on the left is the updated schema of the tmp table to be merged, on the right is the original table

2 Likes

Can you post the config block of your snapshot model? Might be something in there. Also does the model itself run fine locally?

1 Like

Hi Fraser and thank you for replying!
Attached is the screenshot of the config block. Running it locally also produces the same error.
Thank you for trying to help!

I just tried to reproduce this on a simple test model and it failed again with the same error.
Created initial snapshot of a table that contains nested column → Added one more subcolumn to the nested column of the table → Tried to ran snapshot and it failed.
So it does look like snapshots doesn’t not capture schema changes in the nested fields

Hey, having the exact same issue. Please how did you resolve your problem?

1 Like

still not solved unfortunately. Ended up rebuilding the snapshot. I think its a bug, i opened an issue in dbt’s repo

I’m running into the same issue when trying to upgrade from 1.0 to 1.5. Our snapshot has two String Array columns and I’m getting the error: Inequality is not defined for arguments of type ARRAY<STRING>. We are using strategy=‘check’ and check_cols = ‘all’.

So what’s changing from 1.0 to 1.3 (I tested 1.3 and it also throws this error)?