Repository: alibaba/GraphScope (language: python)

Issue:
[BUG] Missing pattern sentences in Pattern Matching in GOpt-based compilation
**Describe the bug**

Based on the new GOpt-based compilation stack, the following pattern outputs unexpected plan:
```
g.V().match(__.as("a").out("2..3", "KNOWS").endV().as("c"), __.as("a").out("KNOWS").as("c")).count()
```
Currently, the optimized plan only preserves the `PathExpand` operator ( for `out("2..3","KNOWS")` ), while miss out the `EdgeExpand` ( for `out("KNOWS")` ) operator. 

The plan looks like:
```
      PhysicalOpr {
            opr: Scan(...)
        PhysicalOpr {
            opr: Repartition(...),
        },
        PhysicalOpr {
            opr: Path(...),
        },
        PhysicalOpr {
            opr: Vertex(...),
        },
        PhysicalOpr {
            opr: GroupBy(...),
        },
        PhysicalOpr {
            opr: Sink(...),
        }
```



Discussion / hints:

Fix patch:
diff --git a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/planner/GraphIOProcessor.java b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/planner/GraphIOProcessor.java
index 2c310c53833d..f630e3fbb13a 100644
--- a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/planner/GraphIOProcessor.java
+++ b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/planner/GraphIOProcessor.java
@@ -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;
@@ -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)));
diff --git a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/graph/RemoteTestGraph.java b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/graph/RemoteTestGraph.java
index 8bcf3191a451..10ebf37bdd74 100644
--- a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/graph/RemoteTestGraph.java
+++ b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/graph/RemoteTestGraph.java
@@ -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(
diff --git a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/graph/calcite/RemoteTestGraph.java b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/graph/calcite/RemoteTestGraph.java
index b617a8309aaf..aa18e7817d98 100644
--- a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/graph/calcite/RemoteTestGraph.java
+++ b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/graph/calcite/RemoteTestGraph.java
@@ -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(


Test patch:
diff --git a/interactive_engine/frontend/src/test/java/com/alibaba/graphscope/RemoteTestGraph.java b/interactive_engine/frontend/src/test/java/com/alibaba/graphscope/RemoteTestGraph.java
index aee62806555e..43b429921109 100644
--- a/interactive_engine/frontend/src/test/java/com/alibaba/graphscope/RemoteTestGraph.java
+++ b/interactive_engine/frontend/src/test/java/com/alibaba/graphscope/RemoteTestGraph.java
@@ -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 =