我在Docker中使用Neo4j v 3.4.1。
我通过密码外壳运行以下查询:
MATCH (blogA:content {entitySubType:"blog"})-[]->(t:term)<-[]-(blogB:content {entitySubType:"blog"})
WHERE blogA <> blogB
RETURN ID(blogA), ID(blogB), count(t);查询数小时后返回null。我无法理解或找到任何能为我找到解决方案的方法。在检查调试日志时,我得到以下信息:
2018-09-08 09:53:54.675+0000 ERROR [o.n.b.v.r.ErrorReporter] Client triggered an unexpected error [Neo.DatabaseError.General.UnknownError]: null, reference 549a05ea-3bee-442b-baf5-fd741d37e2db.
2018-09-08 09:53:54.675+0000 ERROR [o.n.b.v.r.ErrorReporter] Client triggered an unexpected error [Neo.DatabaseError.General.UnknownError]: null, reference 549a05ea-3bee-442b-baf5-fd741d37e2db.
java.lang.NegativeArraySizeException
at scala.collection.mutable.HashTable$class.resize(HashTable.scala:257)
at scala.collection.mutable.HashTable$class.scala$collection$mutable$HashTable$$addEntry0(HashTable.scala:157)
at scala.collection.mutable.HashTable$class.addEntry(HashTable.scala:148)
at scala.collection.mutable.HashMap.addEntry(HashMap.scala:40)
at scala.collection.mutable.HashMap.addEntry(HashMap.scala:93)
at scala.collection.mutable.HashMap.getOrElseUpdate(HashMap.scala:79)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.EagerAggregationPipe$$anonfun$internalCreateResults$1.apply(EagerAggregationPipe.scala:120)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.EagerAggregationPipe$$anonfun$internalCreateResults$1.apply(EagerAggregationPipe.scala:118)
at scala.collection.Iterator$class.foreach(Iterator.scala:891)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1334)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.EagerAggregationPipe.internalCreateResults(EagerAggregationPipe.scala:118)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.PipeWithSource.createResults(Pipe.scala:76)
at org.neo4j.cypher.internal.runtime.interpreted.pipes.PipeWithSource.createResults(Pipe.scala:72)
at org.neo4j.cypher.internal.compatibility.v3_4.runtime.executionplan.BaseExecutionResultBuilderFactory$BaseExecutionWorkflowBuilder.createResults(DefaultExecutionResultBuilderFactory.scala:105)
at org.neo4j.cypher.internal.compatibility.v3_4.runtime.executionplan.BaseExecutionResultBuilderFactory$BaseExecutionWorkflowBuilder.build(DefaultExecutionResultBuilderFactory.scala:77)
at org.neo4j.cypher.internal.compatibility.v3_4.runtime.BuildInterpretedExecutionPlan$$anonfun$getExecutionPlanFunction$1.apply(BuildInterpretedExecutionPlan.scala:97)
at org.neo4j.cypher.internal.compatibility.v3_4.runtime.BuildInterpretedExecutionPlan$$anonfun$getExecutionPlanFunction$1.apply(BuildInterpretedExecutionPlan.scala:80)
at org.neo4j.cypher.internal.compatibility.v3_4.runtime.BuildInterpretedExecutionPlan$InterpretedExecutionPlan.run(BuildInterpretedExecutionPlan.scala:111)
at org.neo4j.cypher.internal.compatibility.LatestRuntimeVariablePlannerCompatibility$ExecutionPlanWrapper$$anonfun$run$1.apply(LatestRuntimeVariablePlannerCompatibility.scala:128)
at org.neo4j.cypher.internal.compatibility.LatestRuntimeVariablePlannerCompatibility$ExecutionPlanWrapper$$anonfun$run$1.apply(LatestRuntimeVariablePlannerCompatibility.scala:124)
at org.neo4j.cypher.exceptionHandler$runSafely$.apply(exceptionHandler.scala:89)
at org.neo4j.cypher.internal.compatibility.LatestRuntimeVariablePlannerCompatibility$ExecutionPlanWrapper.run(LatestRuntimeVariablePlannerCompatibility.scala:124)
at org.neo4j.cypher.internal.PreparedPlanExecution.execute(PreparedPlanExecution.scala:29)
at org.neo4j.cypher.internal.ExecutionEngine.execute(ExecutionEngine.scala:119)
at org.neo4j.cypher.internal.javacompat.ExecutionEngine.executeQuery(ExecutionEngine.java:61)
at org.neo4j.bolt.v1.runtime.TransactionStateMachineSPI$1.start(TransactionStateMachineSPI.java:144)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State.startExecution(TransactionStateMachine.java:444)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State$1.execute(TransactionStateMachine.java:259)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State$1.run(TransactionStateMachine.java:240)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine.run(TransactionStateMachine.java:81)
at org.neo4j.bolt.v1.runtime.BoltStateMachine$State$2.run(BoltStateMachine.java:457)
at org.neo4j.bolt.v1.runtime.BoltStateMachine.run(BoltStateMachine.java:225)
at org.neo4j.bolt.v1.messaging.BoltMessageRouter.lambda$onRun$3(BoltMessageRouter.java:93)
at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:195)
at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:143)
at org.neo4j.bolt.runtime.ExecutorBoltScheduler.executeBatch(ExecutorBoltScheduler.java:170)
at org.neo4j.bolt.runtime.ExecutorBoltScheduler.lambda$scheduleBatchOrHandleError$2(ExecutorBoltScheduler.java:153)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
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)我们在这里共同假定,entitySubType并不是为所有内容节点设置的。我验证了这个假设,这是真的。基于此,我使用如下所示的exists()谓词函数重新构造了我的查询:
MATCH (blogA:content)-[:TaggedWith]->(t:term)<-[:TaggedWith]-(blogB:content)
WHERE ID(blogA) <> ID(blogB) AND exists(blogA.entitySubType) AND
exists(blogB.entitySubType) AND "blog" = blogA.entitySubType AND "blog" =
blogB.entitySubType RETURN ID(blogA), ID(blogB), count(t);该查询在~19.1h (比上次早3分钟)之后再次以tex异常结束。
以下查询计划由EXPLAIN命令提供:

我看不出有什么地方(blogA.entitySubType)会发生。此外,我找不到过滤器"blog“= blogA.entitySubType和"blog”= blogB.entitySubType。
我的查询是错误的还是查询计划的可视化没有完成?
发布于 2018-09-11 09:06:34
听起来它可能是一个空的属性,也许"entitySubType“并不是在所有的帖子上设置的?
错误是一致的还是间歇性的?数据库是否不断更新,如果是,如何更新?
发布于 2018-09-11 09:20:01
属性"entitySubType“可能不会在某些节点中设置,这就是当查询执行发生时,不存在"entitySubType”的节点将不会被返回的原因。确保所有节点都包含entitySubType属性。
https://stackoverflow.com/questions/52272261
复制相似问题