Cypher UNION查询

时间:2013-04-15 15:06:10

标签: neo4j union cypher

我有简单的下图:
http://console.neo4j.org/?id=v0cvwn

我想知道为什么以下查询:

 START n=node(2) 
 match n-[:KNOWS]-node 
 return node.name as name 
 UNION 
 START n=node(2) 
 match n-[:ACTS_IN]-node 
 return node.name as name

抛出异常:

java.lang.AssertionError: assertion failed: Can't profile the same pipe twice
at scala.Predef$.assert(Predef.scala:179)
at org.neo4j.cypher.internal.profiler.Profiler.decorate(Profiler.scala:47)
at org.neo4j.cypher.internal.pipes.Pipe$class.createResults(Pipe.scala:35)
at org.neo4j.cypher.internal.pipes.NullPipe$.createResults(Pipe.scala:47)
at org.neo4j.cypher.internal.pipes.PipeWithSource.createResults(Pipe.scala:61)
at org.neo4j.cypher.internal.pipes.PipeWithSource.createResults(Pipe.scala:61)
at org.neo4j.cypher.internal.pipes.PipeWithSource.createResults(Pipe.scala:61)
at org.neo4j.cypher.internal.pipes.UnionIterator.loadNextIterator$1(UnionIterator.scala:60)
at org.neo4j.cypher.internal.pipes.UnionIterator.step$1(UnionIterator.scala:68)
at org.neo4j.cypher.internal.pipes.UnionIterator.stepIfNeccessary(UnionIterato

关于UNION的几个问题:

是否可以对之前子查询中UNION的结果集中在结果集中累积的所有数据执行另一个最终匹配子句?

是否可以通过该数据执行订单?

感谢。

1 个答案:

答案 0 :(得分:2)

根据这些github评论,UNION仅支持2.0或更高版本。

https://github.com/neo4j/neo4j/issues/125