The apoc.periodic.commit
procedure fails on me, possibly failing to parse my Cypher command. It seems that is it interpreting the value of the limit
parameter as something other than an integer (or a long, to be precise). I've tried using two different drivers, and they give me slightly different errors, which I shall show.
I'm running Neo4j 4.1.1 through the official Docker image.
Below is my Cypher command.
CALL apoc.periodic.commit("MATCH (p:Person) WITH p LIMIT $limit RETURN *", {limit:1000})
I've tried running this command with the neo4j-driver v4.1.1 Python driver.
>>> result = session.run('CALL apoc.periodic.commit("MATCH (p:Person) WITH p LIMIT $limit RETURN *", {limit:1000})')
>>> result.values()
[[0, 0, 0, 1, 1, {"class org.neo4j.kernel.impl.core.NodeEntity cannot be cast to class java.lang.Long (org.neo4j.kernel.impl.core.NodeEntity is in unnamed module of loader 'app'; java.lang.Long is in module java.base of loader 'bootstrap')": 1}, 0, {}, False]]
Below I used the py2neo v5.0b1 Python driver, giving a similar error.
>>> result = graph.run('CALL apoc.periodic.commit("MATCH (p:Person) WITH p LIMIT $limit RETURN *", {limit:1000})')
>>> result
updates | executions | runtime | batches | failedBatches | batchErrors | failedCommits | commitErrors | wasTerminated
---------|------------|---------|---------|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|--------------|---------------
0 | 0 | 0 | 1 | 1 | {`class java.lang.String cannot be cast to class java.lang.Long (java.lang.String and java.lang.Long are in module java.base of loader 'bootstrap')`: 1} | 0 | {} | false
EXPLAIN output
The execution plan of the command shown here: https://gist.github.com/olavurmortensen/2af61e9164fe57711318595bff404756
PROFILE output
The profile of the command is shown here: https://gist.github.com/olavurmortensen/1c71da98a7fe1ad17776f4a4998cb8e3