hands-on-lab-neo4j-and-vertex-ai icon indicating copy to clipboard operation
hands-on-lab-neo4j-and-vertex-ai copied to clipboard

Transaction in LOAD CSV

Open benofben opened this issue 1 year ago • 4 comments

Use transactions in load

:auto LOAD CSV WITH HEADERS FROM 'https://storage.googleapis.com/neo4j-datasets/form13/form13-v2.csv' AS row
CALL { MATCH (m:Manager {managerName:row.managerName})
MATCH (c:Company {cusip:row.cusip})
MERGE (m)-[r:OWNS {reportCalendarOrQuarter:date(row.reportCalendarOrQuarter)}]->(c)
SET r.value = toFloat(row.value), r.shares = toInteger(row.shares)
} IN TRANSACTIONS OF 1000 ROWS;

benofben avatar Sep 05 '23 16:09 benofben