VGalaxies commented on code in PR #2662:
URL:
https://github.com/apache/incubator-hugegraph/pull/2662#discussion_r1769498294
##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/GraphTransaction.java:
##########
@@ -1044,6 +1049,38 @@ public Iterator<Edge> queryEdges(Query query) {
protected Iterator<HugeEdge> queryEdgesFromBackend(Query query) {
assert query.resultType().isEdge();
+ if (query instanceof ConditionQuery && !query.paging()) {
+ // TODO: support: paging + parent label
+ boolean supportIn =
this.storeFeatures().supportsQueryWithInCondition();
+ // consider multi labels + properties, see
org.apache.hugegraph.core.EdgeCoreTest.testQueryInEdgesOfVertexByLabels
+ Stream<ConditionQuery> flattenedQueries =
ConditionQueryFlatten.flatten((ConditionQuery) query, supportIn).stream();
+
+ Stream<Iterator<HugeEdge>> edgeIterators = flattenedQueries.map(cq
-> {
+ Id label = cq.condition(HugeKeys.LABEL);
+ if (this.storeFeatures().supportsFatherAndSubEdgeLabel() &&
+ 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(ExtendableIterator::concat).orElse(Collections.emptyIterator());
+ }
+
+ return queryEdgesFromBackendInternal(query);
+ }
+
+ private Iterator<HugeEdge> queryEdgesFromBackendInternal(Query query) {
+ assert query.resultType().isEdge();
+
Review Comment:
TBD.
because of https://github.com/apache/incubator-hugegraph/pull/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]