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

apoc.merge.node returns java.lang.NullPointerException on "name" #475

Open
v2belleville opened this issue Aug 13, 2023 · 3 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@v2belleville
Copy link

apoc.merge.node returns java.lang.NullPointerException on "name" when there is no "name" property in the data

image
image
image

here is the bug reproduced in Neo4j browser, with this test file (remove txt extension)
followers.test.json.txt
image

call apoc.load.json("followers.test.json") yield value
unwind value["status"] as twJson
merge (u:TwUser {id:"826009201600233474"}) with twJson,u
    call apoc.merge.node([twJson.label,twJson.labelOrigine],twJson) yield node
    with twJson,u,node  where not exists((u)-[:TWEETED]->(node))
    create (u)-[:TWEETED {twExportDate:twJson.twExportDate, importDateTime:localdatetime({ timezone: 'Europe/Paris' })}]->(node)

debug.log says this, but not at the time the above query was run

2023-08-13 08:08:20.500+0000 WARN  [o.n.k.i.c.VmPauseMonitorComponent] Detected VM stop-the-world pause: {pauseTime=6244, gcTime=0, gcCount=0}
2023-08-13 08:08:20.704+0000 WARN  [o.n.k.i.c.VmPauseMonitorComponent] Detected VM stop-the-world pause: {pauseTime=135732722, gcTime=0, gcCount=0}
2023-08-13 08:08:22.168+0000 WARN  [o.n.k.i.c.VmPauseMonitorComponent] Detected VM stop-the-world pause: {pauseTime=1264, gcTime=0, gcCount=0}
2023-08-13 08:08:22.179+0000 WARN  [a.c.ClusterHeartbeat] Cluster Node [akka://cc-discovery-actor-system@localhost:5000] - Scheduled sending of heartbeat was delayed. Previous heartbeat was sent [135739724] ms ago, expected interval is [1000] ms. This may cause failure detection to mark members as unreachable. The reason can be thread starvation, CPU overload, or GC.
2023-08-13 09:11:53.549+0000 INFO  [o.n.k.i.t.l.c.CheckPointerImpl] [neo4j/229ff1a9] Checkpoint triggered by "Scheduled checkpoint for every 15 minutes threshold" @ txId: 36 checkpoint started...
2023-08-13 09:11:53.627+0000 INFO  [o.n.k.i.t.l.c.CheckPointerImpl] [neo4j/229ff1a9] Checkpoint triggered by "Scheduled checkpoint for every 15 minutes threshold" @ txId: 36 checkpoint completed in 76ms. Checkpoint flushed 49 pages (0% of total available pages), in 44 IOs. Checkpoint performed with IO limit: 600, paused in total 0 times( 0 millis).
2023-08-13 09:11:53.627+0000 INFO  [o.n.k.i.t.l.p.LogPruningImpl] [neo4j/229ff1a9] No log version pruned. The strategy used was '2 days'. 
2023-08-13 09:11:57.357+0000 INFO  [o.n.c.i.c.CypherQueryCaches] [neo4j/229ff1a9] Discarded stale query from the query cache after 266 seconds. Reason: IndexPropertyExistsSelectivity(IndexDescriptor(Text,Node(LabelId(3)),List(PropertyKeyId(10)),Set(),NONE,DoNotGetValue,None,false)) changed from 0.0 to 0.1, which is a divergence of 1.0 which is greater than threshold 0.7033643993854399. Query id: 4514.

Versions

  • OS: Windows 10
  • Neo4j: desktop 1.5.8 with 5.9.0 db
  • Neo4j-Apoc: 5.9
@nadja-muller
Copy link
Contributor

Thanks for reporting this. We will come back to you once we had a look.

@nadja-muller nadja-muller added the bug Something isn't working label Aug 15, 2023
@nadja-muller
Copy link
Contributor

nadja-muller commented Oct 3, 2023

Hi.

Thanks again for reporting this. The problem in your query is that some of the labels passed into apoc.merge.nodes are null. You could add an additional check similar to this snippet here:

WITH {label: ''a', labelOrigin: 'b'} as twJson
WHERE twJson.label IS NOT NULL and twJson.labelOrigin IS NOT NULL
call apoc.merge.node([twJson.label, twJson.labelOrigin],twJson) yield node
RETURN node

While this behavior won't change, we will fix the code to return a proper error message.
Let us know if this does not solve your issue.

@nadja-muller nadja-muller self-assigned this Oct 5, 2023
@v2belleville
Copy link
Author

thanks Nadja, I'd over simplified the test json, but in the real code, it was indeed because twJson.label and twJson.labelOrigin were null that the whole thing broke. a message saying labels have null value will definitely be more helpful !

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
Development

No branches or pull requests

2 participants