Why does the facebook tap use composite primary ke...
# plugins-dbt
s
Why does the facebook tap use composite primary keys for some streams? Eg: https://github.com/MeltanoLabs/tap-facebook/blob/9fc57d954ca10ab031a8c309b9ebaba397d591b8/tap_facebook/streams/campaign.py#L73 Shouldn't just
id
be enough? Wouldn't some targets have duplicates in the resulting table if we use
id
and
updated_time
to check for uniqueness when merging/upserting?
👀 1
a
If this is a deliberate decision, then I guess it's to give a SCD2 approach as your campaigns go in and out of 'PAUSED' status, spend cap changes etc. But it's not obvious, far off the default behaviour IMO. Probably requires a callout in the docs.
v
yeah for that though andy the recommendation is to swap the primary key to [] so you're in "append only" mode
🤷