VGalaxies commented on code in PR #2662:
URL:
https://github.com/apache/incubator-hugegraph/pull/2662#discussion_r1793709678
##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/GraphTransaction.java:
##########
@@ -1617,6 +1618,19 @@ private Query optimizeQuery(ConditionQuery query) {
if (query.resultType().isVertex()) {
verifyVerticesConditionQuery(query);
} else if (query.resultType().isEdge()) {
+ // fix
org.apache.hugegraph.api.traverser.EdgeExistenceAPITest#testEdgeExistenceGet
+ // add sub label if only the sub label is missing
+ ConditionQuery finalQuery = query;
+ if (this.storeFeatures().supportsFatherAndSubEdgeLabel() &&
+ query.condition(HugeKeys.SUB_LABEL) == null &&
+ Arrays.stream(EdgeId.KEYS)
+ .filter(key -> !Objects.equals(key,
HugeKeys.SUB_LABEL))
+ .allMatch(key -> finalQuery.condition(key) != null))
{
+ EdgeLabel el = this.graph().edgeLabel(label);
+ if (!el.isFather()) {
+ query.eq(HugeKeys.SUB_LABEL, el.id());
+ }
+ }
Review Comment:
TBD.
--
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]