Hi. here is one approach to the query you are looking for
LOAD CSV WITH HEADERS from "{link to file}" as line
CREATE (n:Operator)
SET n.linenumber = linenumber(),
n.id = line.`Operator ID`,
n.activity = line.`Activity Done`
WITH n
MATCH (n1:Operator) WHERE n1.linenumber = n.linenumber-1
CREATE (n1)-[:HAS_RELATION]->(n)
REMOVE n.linenumber,n1.linenumber
RETURN n1,n
When applying it to my dataset it is showing: The execution plan for this query contains the Eager operator, which forces all dependent data to be materialized in main memory before proceeding. What does it mean? Do I need to worry about it?
Yes sorry. That's because you are creating nodes and then matching those same nodes in one query. You can split it into two queries like this to avoid the warning.
USING PERIODIC COMMIT 1000
LOAD CSV WITH HEADERS from "http://localhost:11001/project-619d0035-18f6-4531-bb33-5502f63c41a9/test.csv" as line
CREATE (n:Operator)
SET n.linenumber = linenumber(),
n.id = line.`Operator ID`,
n.activity = line.`Activity Done`;
MATCH (n:Operator)
MATCH (n1:Operator) WHERE n1.linenumber = n.linenumber-1
CREATE (n1)-[:HAS_RELATION]->(n)
REMOVE n.linenumber,n1.linenumber
RETURN n1,n;
This also uses the PERIODIC COMMIT suggested by @dana_canzano