Closed PoshAlpaca closed 3 years ago
@PoshAlpaca thank you for reaching us, can you share a simple dataset that allows us to reproduce the problem?
This occurs when exporting a graph of any size as long as there is a property somewhere with the DateTime
type. So starting from an empty graph, creating a node with CREATE (:TestNode {created: datetime()})
and then exporting with CALL apoc.export.cypher.all('backup.cypher', {useOptimizations: {type: 'UNWIND_BATCH_PARAMS', unwindBatchSize:100}})
should produce the following cypher script that causes the cypher-shell
error:
:begin
CREATE CONSTRAINT ON (node:`UNIQUE IMPORT LABEL`) ASSERT (node.`UNIQUE IMPORT ID`) IS UNIQUE;
:commit
:begin
:param rows => [{_id:1, properties:{created:datetime('2020-11-26T21:36:04.212Z')}}]
UNWIND $rows AS row
CREATE (n:`UNIQUE IMPORT LABEL`{`UNIQUE IMPORT ID`: row._id}) SET n += row.properties SET n:TestNode;
:commit
:begin
MATCH (n:`UNIQUE IMPORT LABEL`) WITH n LIMIT 20000 REMOVE n:`UNIQUE IMPORT LABEL` REMOVE n.`UNIQUE IMPORT ID`;
:commit
:begin
DROP CONSTRAINT ON (node:`UNIQUE IMPORT LABEL`) ASSERT (node.`UNIQUE IMPORT ID`) IS UNIQUE;
:commit
@PoshAlpaca the bug seems to be caused by cypher-shell
. I have opened a related issue https://github.com/neo4j/cypher-shell/issues/286
Expected Behavior (Mandatory)
The cypher file gets executed without any errors by cypher-shell and the backed up data is properly recreated.
Actual Behavior (Mandatory)
Cypher-shell returns a "Failed to evaluate expression" error and exits.
How to Reproduce the Problem
The error occurs whenever cypher-shell encounters a
:param
line that contains a function likedatetime('2020-11-23T22:21:02.554Z')
. These:param
lines are generated by theapoc.export.cypher.all
function when run withUNWIND_BATCH_PARAMS
optimizations enabled.Steps (Mandatory)
DateTime
e.g.CREATE (:TestNode {created: datetime()})
CALL apoc.export.cypher.all('backup.cypher', {useOptimizations: {type: 'UNWIND_BATCH_PARAMS', unwindBatchSize:100}})
backup.cypher
with cypher-shell:cat backup.cypher | cypher-shell
Specifications (Mandatory)
Currently used versions
Versions