【问题标题】:Cypher: ThisShouldNotHappenError: This execution plan should not existCypher:ThisShouldNotHappenError:此执行计划不应该存在
【发布时间】:2013-04-22 16:42:10
【问题描述】:

以下查询有什么问题? [Neo4j 1.8.2,嵌入式]

start merchant = node:merchants('id:10')
match (merchant)<-[:VALID_AT]-(offer)-[:TARGET_PINCODE]->(pincode)<-[:RESIDES_IN]-(customer) where (offer)-[:VALID_OFFER]->() and offer.endDate > 1
return count(offer)

Webadmin 返回未定义

Java 异常:

org.neo4j.helpers.ThisShouldNotHappenError: Developer: Andres 声称 那:这个执行计划不应该存在。在 org.neo4j.cypher.internal.commands.PathExpression$$anonfun$4.apply(PathExpression.scala:47) 在 org.neo4j.cypher.internal.commands.PathExpression$$anonfun$4.apply(PathExpression.scala:46) 在 scala.collection.LinearSeqOptimized$class.exists(LinearSeqOptimized.scala:79) 在 scala.collection.immutable.List.exists(List.scala:45) 在 org.neo4j.cypher.internal.commands.PathExpression.apply(PathExpression.scala:46) 在 org.neo4j.cypher.internal.commands.PathExpression.apply(PathExpression.scala:31) 在 org.neo4j.cypher.internal.commands.NonEmpty.isMatch(Predicate.scala:283) 在 org.neo4j.cypher.internal.commands.And.isMatch(Predicate.scala:83) 在 org.neo4j.cypher.internal.pipes.matching.FilteringIterable$FilteringIterator.spoolToNextInLine(FilteringIterable.scala:55) 在 org.neo4j.cypher.internal.pipes.matching.FilteringIterable$FilteringIterator.(FilteringIterable.scala:34) 在 org.neo4j.cypher.internal.pipes.matching.FilteringIterable.iterator(FilteringIterable.scala:72) 在 org.neo4j.cypher.internal.pipes.matching.FilteringIterable.iterator(FilteringIterable.scala:27​​) 在 scala.collection.JavaConversions$IterableWrapperTrait$class.iterator(JavaConversions.scala:557) 在 scala.collection.JavaConversions$IterableWrapper.iterator(JavaConversions.scala:583) 在 scala.collection.JavaConversions$IterableWrapper.iterator(JavaConversions.scala:583) 在 org.neo4j.kernel.impl.traversal.TraversalBranchWithState.expandRelationshipsWithoutChecks(TraversalBranchWithState.java:70) 在 org.neo4j.kernel.impl.traversal.TraversalBranchImpl.expandRelationships(TraversalBranchImpl.java:104) 在 org.neo4j.kernel.impl.traversal.StartNodeTraversalBranch.next(StartNodeTraversalBranch.java:47) 在 org.neo4j.kernel.impl.traversal.AsOneStartBranch.next(AsOneStartBranch.java:100) 在 org.neo4j.kernel.PreorderDepthFirstSelector.next(PreorderDepthFirstSelector.java:52) 在 org.neo4j.kernel.impl.traversal.TraverserIterator.fetchNextOrNull(TraverserIterator.java:65) 在 org.neo4j.kernel.impl.traversal.TraverserIterator.fetchNextOrNull(TraverserIterator.java:34) 在 org.neo4j.helpers.collection.PrefetchingIterator.hasNext(PrefetchingIterator.java:55) 在 scala.collection.JavaConversions$JIteratorWrapper.hasNext(JavaConversions.scala:574) 在 scala.collection.Iterator$$anon$21.hasNext(Iterator.scala:371) 在 scala.collection.Iterator$$anon$21.hasNext(Iterator.scala:371) at scala.collection.Iterator$$anon$22.hasNext(Iterator.scala:388) 在 scala.collection.Iterator$class.foreach(Ite​​rator.scala:660) 在 scala.collection.Iterator$$anon$22.foreach(Ite​​rator.scala:382) 在 org.neo4j.cypher.internal.pipes.EagerAggregationPipe.createResults(EagerAggregationPipe.scala:76) 在 org.neo4j.cypher.internal.pipes.ColumnFilterPipe.createResults(ColumnFilterPipe.scala:37) 在 org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl$$anonfun$6.apply(ExecutionPlanImpl.scala:127) 在 org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl$$anonfun$6.apply(ExecutionPlanImpl.scala:125) 在 org.neo4j.cypher.internal.executionplan.ExecutionPlanImpl.execute(ExecutionPlanImpl.scala:33) 在 org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:59) 在 org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:63) 在 org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:79)

注意:return offer 代替 return count(offer) 有效

【问题讨论】:

  • 我希望我能更多地投票
  • 99% 确定这已在 1.9 中修复。 :(
  • :-( Wes,我敢肯定你已经提到过它,但有什么解决方法吗?这是较大查询的最小部分,因此在代码中计算报价将不起作用很好

标签: neo4j cypher


【解决方案1】:

升级到 Neo4j 1.9 RC1 问题不再存在

【讨论】:

  • 1.8.2 上的解决方法:将 (offer)-[:VALID_OFFER]->() 移动到匹配子句中。开始商家=节点:商家('id:10')匹配(商家)(密码)() WHERE offer.endDate > 1 return count(offer)
猜你喜欢
  • 2012-06-19
  • 2012-02-18
  • 1970-01-01
  • 2017-03-22
  • 2017-04-22
  • 2023-01-26
  • 2012-05-07
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多