Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypher script generated by apoc.export.cypher.all leaves the temporary UNIQUE IMPORT ID REL relationship properties #631

Closed
HEnquist opened this issue May 27, 2024 · 1 comment · Fixed by #632
Assignees
Labels
bug Something isn't working

Comments

@HEnquist
Copy link

Guidelines

Please note that GitHub issues are only meant for bug reports/feature requests. If you have questions on how to use APOC, please ask on the Neo4j Discussion Forum instead of creating an issue here.

Expected Behavior (Mandatory)

When executing the cypher script, I expect the temporary UNIQUE IMPORT ID REL relationship properties to be removed, as is done for the similar UNIQUE IMPORT ID node properties.

Actual Behavior (Mandatory)

All created relationships have an unwanted UNIQUE IMPORT ID REL property.

How to Reproduce the Problem

Simple Dataset (where it's possibile)

This tiny dataset is sufficient:

CREATE (n:DummyNode)-[r:DUMMYREL]->(m:OtherDummy)

Steps (Mandatory)

  1. Select a database with some data (the exact data is unimportant).

  2. Export as cypher, with the multipleRelationshipsWithType option set to true:

CALL apoc.export.cypher.all(null, {format: 'cypher-shell', multipleRelationshipsWithType: true})
  1. Check the resulting cypher statements. Example:
:begin
CREATE CONSTRAINT UNIQUE_IMPORT_NAME FOR (node:`UNIQUE IMPORT LABEL`) REQUIRE (node.`UNIQUE IMPORT ID`) IS UNIQUE;
:commit
CALL db.awaitIndexes(300);
:begin
UNWIND [{_id:1, properties:{}}] AS row
CREATE (n:`UNIQUE IMPORT LABEL`{`UNIQUE IMPORT ID`: row._id}) SET n += row.properties SET n:OtherDummy;
UNWIND [{_id:0, properties:{}}] AS row
CREATE (n:`UNIQUE IMPORT LABEL`{`UNIQUE IMPORT ID`: row._id}) SET n += row.properties SET n:DummyNode;
:commit
:begin
UNWIND [{start: {_id:0}, id: 0, end: {_id:1}, properties:{}}] AS row
MATCH (start:`UNIQUE IMPORT LABEL`{`UNIQUE IMPORT ID`: row.start._id})
MATCH (end:`UNIQUE IMPORT LABEL`{`UNIQUE IMPORT ID`: row.end._id})
CREATE (start)-[r:DUMMYREL{`UNIQUE IMPORT ID REL`:row.id}]->(end) SET r += row.properties;
: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 UNIQUE_IMPORT_NAME;
:commit
  1. Note that the UNIQUE IMPORT ID node properties are removed at the end, but not the UNIQUE IMPORT ID REL relationship properties.

Screenshots (where it's possibile)

Specifications (Mandatory)

Currently used versions

Versions

  • OS: MacOS (with neo4j running in Docker)
  • Neo4j: 5.18.1
  • Neo4j-Apoc: 5.18.0
@Lojjs Lojjs added the bug Something isn't working label May 28, 2024
@Lojjs
Copy link
Contributor

Lojjs commented May 28, 2024

Thanks for reporting, this is a bug. As you expected all the temporary properties are supposed to be cleaned up. We will let you know when it has been fixed.

Best regards Louise, Neo4j

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants