I've recently tried to upgrade an application using Spring Data Neo4j from 2.1.0.RELEASE to 2.2.0.RELEASE and now I'm getting an error when trying to execute a query with an IN keyword. Everything worked fine in the previous release. Also, the query works fine if executed by the Neo4j web console.
The problem seems to be in the list passed as parameter for the IN clause. The query is:
and the param in the IN clause is passed as a Collection<String>, actually is a List<String> coming from a String[] after calling the Arrays.asList method.
The stack trace after the query call is as following:
I would be grateful to anyone able to give me hints for solving this issue.
The problem seems to be in the list passed as parameter for the IN clause. The query is:
Code:
start m=node:__types__(className="zzz"),p=node(1) match (m)<-[:REL1]->(t)-[:REL2]->(i),(m)<-[r?:REL3]->(rr),(m)<-[?:REL4]-(pp) where i.name IN {param} AND (rr=p or rr is null) and (pp=p or pp is null) return count(distinct m)
The stack trace after the query call is as following:
Code:
java.lang.RuntimeException
at org.neo4j.cypher.internal.pipes.matching.MiniMap.newWith(ExpanderStep.scala:172)
at org.neo4j.cypher.internal.pipes.matching.MiniMap.newWith(ExpanderStep.scala:155)
at org.neo4j.cypher.internal.commands.InCollection$$anonfun$isMatch$1.apply(InCollection.scala:39)
at org.neo4j.cypher.internal.commands.InCollection$$anonfun$isMatch$1.apply(InCollection.scala:38)
at scala.collection.IndexedSeqOptimized$$anonfun$exists$1.apply(IndexedSeqOptimized.scala:41)
at scala.collection.IndexedSeqOptimized$$anonfun$exists$1.apply(IndexedSeqOptimized.scala:41)
at scala.collection.IndexedSeqOptimized$class.segmentLength(IndexedSeqOptimized.scala:190)
at scala.collection.mutable.WrappedArray.segmentLength(WrappedArray.scala:33)
at scala.collection.GenSeqLike$class.prefixLength(GenSeqLike.scala:82)
at scala.collection.mutable.WrappedArray.prefixLength(WrappedArray.scala:33)
at scala.collection.IndexedSeqOptimized$class.exists(IndexedSeqOptimized.scala:41)
at scala.collection.mutable.WrappedArray.exists(WrappedArray.scala:33)
at org.neo4j.cypher.internal.commands.AnyInCollection$$anonfun$seqMethod$2.apply(InCollection.scala:71)
at org.neo4j.cypher.internal.commands.AnyInCollection$$anonfun$seqMethod$2.apply(InCollection.scala:71)
at org.neo4j.cypher.internal.commands.InCollection.isMatch(InCollection.scala:38)
at org.neo4j.cypher.internal.commands.And.isMatch(Predicate.scala:83)
at org.neo4j.cypher.internal.pipes.matching.FilteringIterable$FilteringIterator.spoolToNextInLine(FilteringIterable.scala:55)
at org.neo4j.cypher.internal.pipes.matching.FilteringIterable$FilteringIterator.<init>(FilteringIterable.scala:34)
at org.neo4j.cypher.internal.pipes.matching.FilteringIterable.iterator(FilteringIterable.scala:72)
at org.neo4j.cypher.internal.pipes.matching.FilteringIterable.iterator(FilteringIterable.scala:27)
at scala.collection.JavaConversions$IterableWrapperTrait$class.iterator(JavaConversions.scala:557)
at scala.collection.JavaConversions$IterableWrapper.iterator(JavaConversions.scala:583)
at scala.collection.JavaConversions$IterableWrapper.iterator(JavaConversions.scala:583)
at org.neo4j.kernel.impl.traversal.TraversalBranchWithState.expandRelationshipsWithoutChecks(TraversalBranchWithState.java:70)
at org.neo4j.kernel.impl.traversal.TraversalBranchImpl.expandRelationships(TraversalBranchImpl.java:104)
at org.neo4j.kernel.impl.traversal.TraversalBranchImpl$2.hasNext(TraversalBranchImpl.java:139)
at org.neo4j.kernel.impl.traversal.TraversalBranchImpl.next(TraversalBranchImpl.java:150)
at org.neo4j.kernel.impl.traversal.TraversalBranchWithState.next(TraversalBranchWithState.java:32)
at org.neo4j.kernel.PreorderDepthFirstSelector.next(PreorderDepthFirstSelector.java:52)
at org.neo4j.kernel.impl.traversal.TraverserIterator.fetchNextOrNull(TraverserIterator.java:65)
at org.neo4j.kernel.impl.traversal.TraverserIterator.fetchNextOrNull(TraverserIterator.java:34)
at org.neo4j.helpers.collection.PrefetchingIterator.hasNext(PrefetchingIterator.java:55)
at scala.collection.JavaConversions$JIteratorWrapper.hasNext(JavaConversions.scala:574)
at scala.collection.Iterator$$anon$21.hasNext(Iterator.scala:371)
at scala.collection.Iterator$$anon$21.hasNext(Iterator.scala:371)
at scala.collection.Iterator$$anon$22.hasNext(Iterator.scala:388)
at scala.collection.Iterator$$anon$21.hasNext(Iterator.scala:371)
at scala.collection.Iterator$$anon$21.hasNext(Iterator.scala:371)
at scala.collection.Iterator$$anon$22.hasNext(Iterator.scala:388)
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
at scala.collection.Iterator$$anon$22.foreach(Iterator.scala:382)
at org.neo4j.cypher.internal.pipes.EagerAggregationPipe.createResults(EagerAggregationPipe.scala:76)
at org.neo4j.cypher.internal.pipes.ColumnFilterPipe.createResults(ColumnFilterPipe.scala:37)
at org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl$$anonfun$6.apply(ExecutionPlanImpl.scala:127)
at org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl$$anonfun$6.apply(ExecutionPlanImpl.scala:125)
at org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl.execute(ExecutionPlanImpl.scala:33)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:59)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:63)
at org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:79)
at org.springframework.data.neo4j.support.query.CypherQueryEngine.parseAndExecuteQuery(CypherQueryEngine.java:61)
at org.springframework.data.neo4j.support.query.CypherQueryEngine.query(CypherQueryEngine.java:49)
at org.springframework.data.neo4j.support.Neo4jTemplate.query(Neo4jTemplate.java:521)