VGalaxies commented on code in PR #2662:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2662#discussion_r1756108423


##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/GraphTransaction.java:
##########
@@ -1044,6 +1049,35 @@ public Iterator<Edge> queryEdges(Query query) {
     protected Iterator<HugeEdge> queryEdgesFromBackend(Query query) {
         assert query.resultType().isEdge();
 
+        if (query instanceof ConditionQuery) {
+            boolean supportIn = 
this.storeFeatures().supportsQueryWithInCondition();
+            Stream<ConditionQuery> flattenedQueries = 
ConditionQueryFlatten.flatten((ConditionQuery) query, supportIn).stream();
+
+            Stream<Iterator<HugeEdge>> edgeIterators = flattenedQueries.map(cq 
-> {
+                Id label = cq.condition(HugeKeys.LABEL);
+                if (label != null &&
+                    graph().edgeLabel(label).isFather() &&
+                    cq.condition(HugeKeys.SUB_LABEL) == null &&
+                    cq.condition(HugeKeys.OWNER_VERTEX) != null &&
+                    cq.condition(HugeKeys.DIRECTION) != null &&
+                    matchEdgeSortKeys(cq, false, this.graph())) {
+                    // g.V("V.id").outE("parentLabel").has("sortKey","value")
+                    return parentElQueryWithSortKeys(
+                            graph().edgeLabel(label), graph().edgeLabels(), 
cq);
+                } else {
+                    return queryEdgesFromBackendInternal(cq);
+                }
+            });
+
+            return 
edgeIterators.reduce(Iterators::concat).orElse(Collections.emptyIterator());
+        }
+
+        return queryEdgesFromBackendInternal(query);
+    }

Review Comment:
   because of #1737



-- 
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]

Reply via email to