I'd like to use apoc.periodic.iterate with flights_50k.csv which file from GraphConnect2017 import training.
call apoc.periodic.iterate("
unwind $files as file
load csv with headers from file as row return row",
"create (p:Person {name:row.name}) ...",
{batchSize:10000,iterateList:true});
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:///flights_50k.csv" AS row
MERGE (origin:Airport {code: row.Origin})
MERGE (destination:Airport {code: row.Dest})
WITH row.UniqueCarrier + row.FlightNum + " " + row.Year + "-" + row.Month + "-" + row.DayofMonth + " " + row.Origin + "_" + row.Dest AS flightIdentifier, row, origin, destination
MERGE (flight:Flight { id: flightIdentifier })
ON CREATE SET flight.date = row.Year + "-" + row.Month + "-" + row.DayofMonth,
flight.airline = row.UniqueCarrier, flight.number = row.FlightNum, flight.departure = row.CRSDepTime,
flight.arrival = row.CRSArrTime, flight.distance = row.Distance, flight.cancelled = row.Cancelled
MERGE (flight)-[:ORIGIN]->(origin)
MERGE (flight)-[:DESTINATION]->(destination)
I tried to merge apoc.periodic,iterate and LOAD CSV~~.
However, I failed with below ERROR
FROM
call apoc.periodic.iterate("
load csv with headers from "file:///flight_init.csv" as row return row",
"MERGE (origin:Airport {code: row.Origin})
MERGE (destination:Airport {code: row.Dest})
WITH row.UniqueCarrier + row.FlightNum + "
" + row.Year + "-" + row.Month + "-" + row.DayofMonth + " " + row.Origin + "_" + row.Dest AS flightIdentifier, row, origin, destination
MERGE (flight:Flight { id: flightIdentifier })
ON CREATE SET flight.date = row.Year + "-" + row.Month + "-" + row.DayofMonth,
flight.airline = row.UniqueCarrier, flight.number = row.FlightNum, flight.departure = row.CRSDepTime,
flight.arrival = row.CRSArrTime, flight.distance = row.Distance, flight.cancelled = row.Cancelled
MERGE (flight)-[:ORIGIN]->(origin)
MERGE (flight)-[:DESTINATION]->(destination)",
{batchSize:10000,iterateList:true});
WHAT're wrong with me?