Skip to content

Commit

Permalink
throw unsupported exception for multi-edge patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
BingqingLyu committed May 16, 2024
1 parent f15605b commit 98fbc2c
Showing 1 changed file with 17 additions and 2 deletions.
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

0 comments on commit 98fbc2c

Please sign in to comment.