埋め込み Java API を使用して、Cypher クエリで IN 演算子を使用する際に問題が発生しています。start
句で取得されたエンティティ以外の識別子で IN 演算子を使用できないようです。
たとえば、ここに私のクエリがあります:
start n=node(someLongNodeId)
match n--m
where m.gnid? IN [\"someStringId\",\"otherStringId\"]
return m
のプロパティをフィルタリングするときに IN 演算子を使用できますが、上記のクエリを実行してから返されたn
を呼び出そうとすると、次の例外で失敗します。hasNext()
Iterator
columnAs("m")
Exception in thread "main" 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.LinearSeqOptimized$class.exists(LinearSeqOptimized.scala:79)
at scala.collection.immutable.List.exists(List.scala:45)
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.StartNodeTraversalBranch.next(StartNodeTraversalBranch.java:47)
at org.neo4j.kernel.impl.traversal.AsOneStartBranch.next(AsOneStartBranch.java:100)
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$19.hasNext(Iterator.scala:334)
at scala.collection.Iterator$$anon$19.hasNext(Iterator.scala:334)
at org.neo4j.cypher.PipeExecutionResult.hasNext(PipeExecutionResult.scala:138)
at scala.collection.Iterator$$anon$19.hasNext(Iterator.scala:334)
at scala.collection.Iterator$$anon$19.hasNext(Iterator.scala:334)
at scala.collection.JavaConversions$IteratorWrapper.hasNext(JavaConversions.scala:562)
at com.awesomecompany.data.neo.NeoTestDriver.performBidirectionalQuery(NeoTestDriver.java:122)
at com.awesomecompany.data.neo.NeoTestDriver.main(NeoTestDriver.java:44)
私の例以外n
で IN 演算子を使用できないという私の仮定は正しいですか? これはバグですか、それとも仕様ですか?