I'm losing some data in my output and need help to identify the issue. We create a hashkey using the below 3 columns, rest is pretty much straight forward select from data source Upsert on hashkey.
SET hashkey = MD5(advertiser_id || marketplace_id || retailer);
SELECT hashkey,
col1, col2, col3...
REPLACE ON DUPLICATE hashkey