Issue 1:
Neo4j version: 4.4.12-enterprise

Operating system: ubuntu 22.04 Docker Mode

Steps to reproduce

bin/neo4j-admin import --skip-duplicate-nodes --database=test --nodes=a=import/20779588711874560/a_node_header.csv,import/20779588711874560/[0-9]_a_node.csv --relationships=transfer=import/20779588711874560/transfer_relationship_header.csv,import/20779588711874560/[0-9]_transfer_relationship.csv

jstack.txt

console.txt

I figure out that the neo4j server is doing unstopped sort job in idmapper prepare step.

Some idea about too many nodes? There are about 2 billion lines of node in my import csv, contains duplicated nodes.

Should I manual remove duplicated nodes to speed up import.

Issue 2:
When running the following query we receive a key not found: UNNAMED60 error (Neo.DatabaseError.General.UnknownError):

MATCH (s:NODE)<-[:IS_VERSION_OF]-(sv:NODE_VERSION),
p = (s)-[*0..]->(:`NODE`)
WHERE (s.id IN ['42a8c128-f575-488f-a914-ba18157ae124'])
AND (NOT(sv.until < 20180101 OR sv.from > 20181231))
AND (ALL(r IN relationships(p) WHERE NOT(r.until < 20180101 OR r.from > 20181231)))
AND ALL(x IN nodes(p) WHERE single(y IN nodes(p) WHERE y = x))
RETURN p

The following query however works as expected:

MATCH (s:NODE)<-[:IS_VERSION_OF]-(sv:NODE_VERSION),
p = (s)-[*0..]->(:`NODE`)
WHERE (s.id IN ['42a8c128-f575-488f-a914-ba18157ae124'])
AND (NOT(sv.until < 20180101 OR sv.from > 20181231))
AND (ALL(r IN relationships(p) WHERE NOT(r.until < 20180101 OR r.from > 20181231)))
WITH p
WHERE ALL(x IN nodes(p) WHERE single(y IN nodes(p) WHERE y = x))
RETURN p

Note the WITH clause between the path match and the node-duplication condition.

Neo4j Version: 3.3.4-enterprise

Operating System: Mac OS X using official Neo4j docker image

API: Neo4j browser / cypher shell

Expected behavior

Query should work.

Actual behavior

Query results in an error.

Steps to reproduce

start empty Neo4j instance

FOREACH (id IN range(0,100) | CREATE (:NODE {id:id}))

MATCH (n1:NODE),(n2:NODE) WITH n1,n2 LIMIT 500 WHERE rand() < 0.1 CREATE (n1)-[:X {a: 1}]->(n2)

MATCH (s:NODE), p = (s)-[*0..]->(:NODE) WHERE (s.id IN [1]) AND (ALL(r IN relationships(p) WHERE NOT(r.a < 1 OR r.a > 1))) AND ALL(x IN nodes(p) WHERE single(y IN nodes(p) WHERE y = x)) RETURN p does not work

MATCH (s:NODE), p = (s)-[*0..]->(:NODE) WHERE (s.id IN [1]) AND (ALL(r IN relationships(p) WHERE NOT(r.a < 1 OR r.a > 1))) WITH p WHERE ALL(x IN nodes(p) WHERE single(y IN nodes(p) WHERE y = x)) RETURN p does work

This is the debug log output:

2018-04-25 13:47:12.575+0000 ERROR [o.n.b.v.r.ErrorReporter] Client triggered an unexpected error [UnknownError]: key not found: UNNAMED60, reference 889fa316-bcff-4c22-bf89-b7a75795010e.
2018-04-25 13:47:12.575+0000 ERROR [o.n.b.v.r.ErrorReporter] Client triggered an unexpected error [UnknownError]: key not found: UNNAMED60, reference 889fa316-bcff-4c22-bf89-b7a75795010e. key not found: UNNAMED60
java.util.NoSuchElementException: key not found: UNNAMED60
at scala.collection.MapLike$class.default(MapLike.scala:228)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.MapExecutionContext.default(ExecutionContext.scala:56)
at scala.collection.MapLike$class.apply(MapLike.scala:141)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.MapExecutionContext.apply(ExecutionContext.scala:56)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.expressions.ProjectedPath$multiOutgoingRelationshipProjector.apply(ProjectedPath.scala:63)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.expressions.ProjectedPath$multiOutgoingRelationshipProjector.apply(ProjectedPath.scala:61)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.expressions.ProjectedPath$singleNodeProjector.apply(ProjectedPath.scala:37)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.expressions.ProjectedPath$singleNodeProjector.apply(ProjectedPath.scala:35)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.expressions.ProjectedPath.apply(ProjectedPath.scala:83)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.expressions.NullInNullOutExpression.apply(NullInNullOutExpression.scala:30)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.InList.isMatch(InList.scala:43)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.commands.predicates.Predicate.isTrue(Predicate.scala:41)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.CommunityPipeBuilder$$anonfun$asCommand$1$1$$anonfun$apply$5.apply(CommunityPipeBuilder.scala:316)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.CommunityPipeBuilder$$anonfun$asCommand$1$1$$anonfun$apply$5.apply(CommunityPipeBuilder.scala:314)
at scala.collection.Iterator$class.forall(Iterator.scala:903)
at scala.collection.AbstractIterator.forall(Iterator.scala:1334)
at scala.collection.IterableLike$class.forall(IterableLike.scala:75)
at scala.collection.AbstractIterable.forall(Iterable.scala:54)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.CommunityPipeBuilder$$anonfun$asCommand$1$1.apply(CommunityPipeBuilder.scala:314)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.CommunityPipeBuilder$$anonfun$asCommand$1$1.apply(CommunityPipeBuilder.scala:313)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.CommunityPipeBuilder$$anon$1.filterNode(CommunityPipeBuilder.scala:329)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.pipes.VarLengthExpandPipe$$anon$1.next(VarLengthExpandPipe.scala:65)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.pipes.VarLengthExpandPipe$$anon$1.next(VarLengthExpandPipe.scala:62)
at scala.collection.Iterator$$anon$14.hasNext(Iterator.scala:535)
at scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:439)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.profiler.ProfilingIterator.hasNext(Profiler.scala:184)
at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:462)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.profiler.ProfilingIterator.hasNext(Profiler.scala:184)
at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:409)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.profiler.ProfilingIterator.hasNext(Profiler.scala:184)
at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:409)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.profiler.ProfilingIterator.hasNext(Profiler.scala:184)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.ClosingIterator.hasNext(ResultIterator.scala:58)
at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:409)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.helpers.RuntimeJavaValueConverter$feedIteratorToVisitable.accept(RuntimeJavaValueConverter.scala:53)
at org.neo4j.cypher.internal.compatibility.v3_3.runtime.PipeExecutionResult.accept(PipeExecutionResult.scala:112)
at org.neo4j.cypher.internal.compatibility.ClosingExecutionResult$$anonfun$accept$2.apply$mcV$sp(ClosingExecutionResult.scala:175)
at org.neo4j.cypher.internal.compatibility.ClosingExecutionResult$$anonfun$accept$2.apply(ClosingExecutionResult.scala:174)
at org.neo4j.cypher.internal.compatibility.ClosingExecutionResult$$anonfun$accept$2.apply(ClosingExecutionResult.scala:174)
at org.neo4j.cypher.internal.compatibility.v3_3.exceptionHandler$runSafely$.apply(exceptionHandler.scala:90)
at org.neo4j.cypher.internal.compatibility.ClosingExecutionResult.accept(ClosingExecutionResult.scala:174)
at org.neo4j.bolt.v1.runtime.CypherAdapterStream.accept(CypherAdapterStream.java:76)
at org.neo4j.bolt.v1.messaging.BoltMessageRouter$ResultHandler.onRecords(BoltMessageRouter.java:146)
at org.neo4j.bolt.v1.runtime.BoltStateMachine$State$3.lambda$pullAll$0(BoltStateMachine.java:462)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State$1.streamResult(TransactionStateMachine.java:272)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine.streamResult(TransactionStateMachine.java:105)
at org.neo4j.bolt.v1.runtime.BoltStateMachine$State$3.pullAll(BoltStateMachine.java:461)
at org.neo4j.bolt.v1.runtime.BoltStateMachine.pullAll(BoltStateMachine.java:236)
at org.neo4j.bolt.v1.messaging.BoltMessageRouter.lambda$onPullAll$6(BoltMessageRouter.java:114)
at org.neo4j.bolt.v1.runtime.concurrent.RunnableBoltWorker.execute(RunnableBoltWorker.java:152)
at org.neo4j.bolt.v1.runtime.concurrent.RunnableBoltWorker.executeBatch(RunnableBoltWorker.java:145)
at org.neo4j.bolt.v1.runtime.concurrent.RunnableBoltWorker.run(RunnableBoltWorker.java:110)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at org.neo4j.helpers.NamedThreadFactory$2.run(NamedThreadFactory.java:109)