I am running apoc.create.node against a .CSV file. I need the nodes that can be created to be created even if one or more nodes fails due to a duplicate key.
I run this:
CALL apoc.load.csv('FILE:///C:/Temp/Test/Test/Neo4jTest/import/Neo4j_AttributeProvenance.csv',{sep:","}) YIELD map CALL apoc.create.node([map.NodeType], {Key:map.Key, AttributeName:map.AttributeName, TableName:map.TableName, SchemaName:map.SchemaName, DataType:map.DataType, PreviousKey:map.PreviousKey}) yield node return count(*)
and I get this
Neo4jUtils.ExecActionQuery().execute(): Failed to invoke procedure `apoc.create.node`: Caused by: org.neo4j.graphdb.ConstraintViolationException: Node(357) already exists with label `SubNode` and property `Key` = 'queryprocessingtest.ttablea.testDateTime'
The .CSV file looks like this
NodeType,Key,SchemaName,TableName,AttributeName,DataType,PreviousKey
RootNode,queryprocessingtest.q01.testDateTimeX,queryprocessingtest,q01,testDateTime,datetime,
SubNode,queryprocessingtest.ttablea.testDateTime,queryprocessingtest,ttablea,testDateTime,datetime,queryprocessingtest.q01.testDateTime