Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(interactive): throw unsupported exception for multi-edge patterns in GOpt #3805

Merged
merged 5 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,15 @@ private PatternEdge visitAndAddEdge(
dst = left;
}
PatternEdge edge = visitEdge(expand, src, dst);
inputPattern.addEdge(src, dst, edge);
boolean added = inputPattern.addEdge(src, dst, edge);
if (!added) {
throw new UnsupportedOperationException(
"edge "
+ edge
+ " already exists in the pattern, and pattern with"
+ " multi-edges are not supported yet");
}

vertexOrEdgeDetails.put(
edge, new DataValue(expand.getAliasName(), getFilters(expand)));
return edge;
Expand Down Expand Up @@ -352,7 +360,14 @@ private PatternEdge visitAndAddPxdEdge(
expandEdge.getId(),
expandEdge.isBoth(),
newDetails);
inputPattern.addEdge(src, dst, expandEdge);
boolean added = inputPattern.addEdge(src, dst, expandEdge);
if (!added) {
throw new UnsupportedOperationException(
"edge "
+ expandEdge
+ " already exists in the pattern, and pattern with"
+ " multi-edges are not supported yet");
}
vertexOrEdgeDetails.put(
expandEdge,
new DataValue(pxd.getAliasName(), getFilters(expand)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,10 @@
method = "g_V_valueMap_matchXa_selectXnameX_bX",
test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchTest",
reason = "unsupported")
@Graph.OptOut(
method = "g_V_matchXa_created_b__b_0created_aX",
test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchTest",
reason = "multi-edge pattern unsupported")

// steps nested in match is unsupported yet, will be supported latter, i.e values('name')
@Graph.OptOut(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,10 @@
// "g_V_matchXa_knows_b__b_created_c__a_created_cX_dedupXa_b_cX_selectXaX_byXnameX",
//// test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchTest",
//// reason = "unsupported")
@Graph.OptOut(
method = "g_V_matchXa_created_b__b_0created_aX",
test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchTest",
reason = "multi-edge pattern unsupported")

// need grateful graph
@Graph.OptOut(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,10 @@
// @Graph.OptOut(method="g_VX1X_asXaX_out_hasXageX_whereXgtXaXX_byXageX_name" ,
// test="org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest", reason = "existence
// of property is unsupported")

@Graph.OptOut(
method = "g_V_matchXa_created_b__b_0created_aX",
test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchTest",
reason = "multi-edge pattern unsupported")
// complex steps nested in match is unsupported yet, i.e. where(eq)/count/order/match
@Graph.OptOut(
method =
Expand Down
Loading