I have a csv file with following columns-
Child_Object_ID;
Child_Object_Name;
Child_Object_Type;
Parent_Object_ID;
Parent_Object_Name;
Parent_Object_Type
As the name goes, node that contains (Child_Object_ID Child_Object_Name and Child_Object_Type
) is the child for (Parent_Object_ID Parent_Object_Name and Parent_Object_Type
). These Parent Nodes could be a child for some other Parent node.
This CSV file contains 1.1 million of records. The problem that I am facing, while loading is after 100K records, I dont see any increment in the load process. But the Loading process was continuously running but I don't see any further nodes or relationship are being built.
I am using the following Cypher query to load the data into Neo4j Windows edition-
CREATE INDEX ON :Object(Object_ID)
CREATE INDEX ON :Object(Object_ID, Object_Name, Object_Type)
CREATE INDEX ON :Object(Object_Type)
USING PERIODIC COMMIT 1000
LOAD CSV WITH HEADERS FROM "file:///file1.csv" AS csvLine
MERGE (object1:Object {Object_ID:csvLine.CHILD_OBJECT_ID, Object_Name:csvLine.CHILD_OBJECT_NAME, Object_Type:csvLine.CHILD_OBJECT_TYPE})
MERGE (object2:Object {Object_ID:csvLine.PARENT_OBJECT_ID, Object_Name:csvLine.PARENT_OBJECT_NAME, Object_Type:csvLine.PARENT_OBJECT_TYPE})
MERGE (object1)-[:Child_Of]->(object2)
LOAD CSV
, however, it requires a bit of tinkering. So it is only worth doing if load time really is really an issue (i.e. a load time of ~1 hour is unacceptable for your use case). – Gabor Szarnyas