Hello there
Is it me or the behaviour of MERGE has changed in Neo4j 4.2.5
I think it's because I'm using the SET i = data operator which replace everything.
But in the context of ON CREATE WITH a MERGE clause it should keep the property defined in the merge?
The last MERGE clause in this query doesn't actually add the id property to the Impression node when creating it. Therefore, if I run the query again I have duplicates spawning for execution of the query.
CALL apoc.load.csv('gs://attribution_audit_client_015/csv/bds_pm_media_daily.csv?authenticationType=PRIVATE_KEY',{
ignore:['LI_OneClick_Leads','ad_platform_cookie_hits','Lead_Form_Opens','Account_ID','Platform','Data_source','Account_Name','ad_platform_click_conv','source','medium','Campaign_Name'],
mapping:
{Date:{name:'date'}, Impressions:{name:'quantity', type:'int'}, Cost_USD:{name:'cost', type:'float'}, Clicks:{name:'clicks', type:'int'},Campaign_ID:{name:'campaign_id', type:'int'},Keyword_ID:{name:'keyword_id', type:'int'}}}
) YIELD map
WITH map.date + '-' + toString(map.keyword_id) AS id, {quantity:map.quantity, clicks:map.clicks, cost:map.cost, date:map.date} AS data, {name:map.campaign, id:map.campaign_id} AS campaign, {name:map.keyword, id:map.keyword_id} AS keywordMERGE (i:Impression {id:id})
ON CREATE SET i = data