Pipedrive to big query is syncing duplicates


For some reason, I get multiple deals of the same kind, and I wonder if it should be this way.
Here is an example from a query I ran. What is the identifier I should use to filter it down so I only get distinct deals?

We are using integration between pipedrive and google big query.


At least in docs, it says that pipedrive should be using a key based incremental approach. And upload every deal by id. But clearly, this is not working in this case.

SELECT DISTINCT o.* FROM `xxx.pipedrive.deals` o
     SELECT id,
            MAX(_sdc_sequence) AS seq,
            MAX(_sdc_batched_at) AS batch
    FROM `xxx.pipedrive.deals`
    GROUP BY id) oo
ON o.id = oo.id
AND o._sdc_sequence = oo.seq
AND o._sdc_batched_at = oo.batch