Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-30-2021 02:12 AM
Hi !
I would like to use the apoc.periodic.iterate like this :
CALL apoc.periodic.iterate('UNWIND $parameters as row
WITH row WHERE row.RAF_ID =~ "[0-9]+" RETURN row',
'MERGE (c:Customer {raf_id: row.RAF_ID})
ON CREATE SET c.name = trim(row.Legal_Entity_Name)',
{batchSize:2000, params: {parameters:$parameters}})
My $parameters
here is a list of elements from a json file. My json file has 33588 unique elements but after running the query, only 29588 nodes are created.
I tried changing the batchSize up to 4000 and I only got 25588 nodes created.
After investigation with the size of 2000, it's the 5th and 13th batches that are missing and it's always them which are missing.
Can you help to find out why 2 batches are missing ? Is there a setting that can cause this issue ?
07-01-2021 07:08 AM
This is very strange.
What version of Neo4j and Apoc do you use?
And also, is there something in the errorMessages
column?
07-01-2021 08:21 AM
How do you get the errorMessages
column ?
It appears 2 of my row.Legal_Entity_Name
were integers and were interpreted as well (I didn't know there was integers).
I don't know if it's the right behaviour but it's good to know that trying to trim an integer cancel the entire batch with apoc.periodic.iterate.
07-02-2021 12:27 AM
The trim
of a number throws an exception, so this could cause the skip of the batch.
However the errorMessages
is an output parameter of apoc.periodic.iterate
apoc.periodic.iterate - APOC Documentation,
so if you type CALL apoc.periodic.iterate(....) yield errorMessages return errorMessages
you will see as result the errors
(most likely a Type mismatch: expected String but was Integer
)
All the sessions of the conference are now available online