GitHub
11/28/2025, 9:02 PMtarget-snowflake) (for reference, target-bigquery has a working implementation of this in `dedupe_before_upsert`)
This isn't bulletproof in that if the incoming schema changes, old hashes would become stale. Not sure if there is a way around this, but I believe this approach is fine as a fallback strategy and preferable to no primary key regardless.
Fivetran does something like this with the `_fivetran_id` system column:
•Some considerations: • Name of primary key property to follow(TEXT) is a Fivetran-generated internal unique surrogate primary key. Its value is generated based on the row's set of values and helps us avoid duplicate rows in tables without a primary key._fivetran_id
_sdc convention e.g. _sdc_id, _sdc_auto_id
• SHA256 hash of to avoid collisions (more likely with MD5)
• Metadata (_sdc_*) properties should be ignored
• Record keys should be sorted prior to JSON serialisation for deterministic hashing (hash will change for the same set of keys in different orders)
• How this might work with the (built-in?) load_method setting i.e. should append-only respect this or not
meltano/sdk