cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Phase 2: migrate recent content

Load CSV file to Neo4j with blank data

elzashny
Node

Hi
I am completely new to programming and neo4j . As a part of the class assignment , I had a task to upload a csv file to neo4j. This file has a lot of blank data. So the instruction as part of the assignment is to remove all the blank data before using the MERGE function.
The command I used was:
// Create an incident

:auto USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:///C:/dataset/Incidents/2020-01-metropolitan-incidents.csv" AS csvLine
WITH csvLine
WHERE csvLine.crime_id IS NOT NULL
WITH csvLine
WHERE csvLine.longitude IS NOT NULL
WITH csvLine
WHERE csvLine.latitude IS NOT NULL
WITH csvLine
WHERE csvLine.lsoa_code IS NOT NULL
WITH csvLine
WHERE csvLine.lsoa_name IS NOT NULL
MERGE(i1:Incident {crime_id: csvLine.crime_id, month: csvLine.month, reported_by: csvLine.reported_by, falls_within: csvLine.falls_within,longitude: csvLine.longitude, latitude:csvLine.latitude, location:csvLine.location,lsoa_code:csvLine.lsoa_code, lsoa_name:csvLine. lsoa_name, crime_type:csvLine.crime_type });

But in the above case Neo4j take a lot of time to give the output.
With the same command when I tried using CREATE instead of MERGE , I got an immediate output.
Please guide why?
And also what changes should i do to the command so that I get an immediate response with MERGE.
Thanks

0 REPLIES 0