Z-HUANT commented on code in PR #2408:
URL:
https://github.com/apache/incubator-hugegraph/pull/2408#discussion_r1451892155
##########
hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/graph/EdgeAPI.java:
##########
@@ -291,6 +291,19 @@ public String list(@Context GraphManager manager,
HugeGraph g = graph(manager, graph);
GraphTraversal<?, Edge> traversal;
+
+ // Optimize edge query. Return early when the EdgeLabel does not exist.
+ if (label != null && !g.existsEdgeLabel(label)) {
Review Comment:
我在测试的时候发现,当 EdgeLabel 不存在时,会在上层代码的 makeQuery() 方法检测出来(E.checkArgument),不会进入
GraphTransaction.optimizeQuery 方法,在 GraphTransaction.optimizeQuery
中添加这个检测,是否重复了?
具体的堆栈如下:
edgeLabel:891, StandardHugeGraph (org.apache.hugegraph)
getLabelId:167, SchemaLabel (org.apache.hugegraph.schema)
convSysValueIfNeeded:711, TraversalUtil
(org.apache.hugegraph.traversal.optimize)
convCompare2SyspropRelation:442, TraversalUtil
(org.apache.hugegraph.traversal.optimize)
convCompare2Relation:430, TraversalUtil
(org.apache.hugegraph.traversal.optimize)
convHas2Condition:358, TraversalUtil
(org.apache.hugegraph.traversal.optimize)
fillConditionQuery:320, TraversalUtil
(org.apache.hugegraph.traversal.optimize)
**makeQuery**:155, HugeGraphStep (org.apache.hugegraph.traversal.optimize)
edges:138, HugeGraphStep (org.apache.hugegraph.traversal.optimize)
lambda$new$0:66, HugeGraphStep (org.apache.hugegraph.traversal.optimize)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]