cancel
Showing results for 
Search instead for 
Did you mean: 

Apoc.merge.relationship - permitted range [0,65535]

haidkang
Node

Test system :
Neo4j community server 4.3.6 on CentOS7 - browser

In test system

call db.relationshipTypes() yield relationshipType return count(relationshipType) as numRelTypes;
3X_9_e_9e01da7bd594093d0c291c5c96da93d663f305c2.png

Run the script as below :
( inland_route.csv file's rows are under 500 rows)

:param relType => ("INLAND_GOES_TO");

load csv with headers from "file:///Inland_Route.csv" as row
match ((orgYard:Yard {ydCd: row.LNK_ORG_NOD_CD}))
match ((dstYard:Yard {ydCd: row.LNK_DEST_NOD_CD}))
call apoc.merge.relationship(orgYard,
$relType ,
{
routOrgNodCd: row.ROUT_ORG_NOD_CD,
routDestNodCd: row.ROUT_DEST_NOD_CD,
routSeq: row.ROUT_SEQ,
routDtlSeq: row.ROUT_DTL_SEQ
},
{
lnkOrgNodCd: row.LNK_ORG_NOD_CD,
lnkDestNodCd: row.LNK_DEST_NOD_CD,
prioSeq: row.PRIO_SEQ,
pctlIoBndCd: row.PCTL_IO_BND_CD,
trspModCd: row.TRSP_MOD_CD,
vndrSeq: row.VNDR_SEQ,
vndrNm: row.VNDR_NM
},
dstYard
) yield rel
return rel
;

An error occurred as below

I know the error is caused as a result of hitting the maximum number of relationship types for db.
However It looks like the 65536 limit has not been reached from the query.

4 REPLIES 4

giuseppe_villan
Graph Fellow

@haidkang

This is weird, with the same $relType this should not happen.
Please, can you provide the .csv used in order to replicate the issue, and your apoc version (executing RETURN apoc.version())?

I think my system is weird.

call db.relationshipTypes() yield relationshipType return count(relationshipType) as numRelTypes;
3X_1_c_1c11f9e2f7f859d8539d7897d725fce6a92cd2eb.png

However,
create (p:Person {name : 'haid'});
create (h:Home {name : 'myhome'});

CREATE (a)-[:OWN]->(h)

@haidkang

It looks like after reaching the max relationship type number,
even after deleting some types, the error remains (I think because the internal relationship type id increment for each creation, it doesn't matter if some have been deleted).
I don't know how this happened, however I would suggest you to create a new database and import there what you need.

Thanks for the kind information.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.