Repository: alibaba/GraphScope (language: python)

Issue:
Switch the default compilation stack to the new GOpt-based framework in GIE
**Is your feature request related to a problem? Please describe.**

We have recently introduced a new GOpt-based compilation stack, which offers robust support for both Cypher and Gremlin query languages. This advanced stack enhances the query processing capabilities with both rule-based and cost-based optimization strategies, ensuring efficient execution across various graph query scenarios.

We are currently planning to switch the default compilation stack from the older, IRCore-based implementation to the new, GOpt-based framework. 


[BUG] Unexpected Type Inference in PathExpand
**Describe the bug**

On LDBC Dataset (sf=0.1), we can run the following two queries:
```
# gremlin tests
gremlin> g.V().hasLabel("PERSON").has("id",933).out("5..6").endV().hasLabel("PLACE").has("id",999).count()
==>392
```
while a simiilar query in cypher is:
```
# cypher tests
@neo4j> Match (a:PERSON{id:933})-[c*5..6]->(b:PLACE{id:999})
        return a.id, b.id
        Limit 10;
+----------+
| id | id0 |
+----------+
+----------+
```
The results in the Cypher is empty, which is not as expected. The reason is that, in this case, the type inference tells that the type of `c` should be `isLocatedIn` (from the edge type that `Person-isLocatedIn-Place`). However, in PathExpand, this is not as expected. The path could be like `Person-Knows[4..5]-Person-IsLocatedIn-Place`, etc.




Discussion / hints:

Fix patch:
diff --git a/interactive_engine/compiler/Makefile b/interactive_engine/compiler/Makefile
index 83bd68241617..03b6ccd9c5f4 100644
--- a/interactive_engine/compiler/Makefile
+++ b/interactive_engine/compiler/Makefile
@@ -84,6 +84,9 @@ ldbc_test:
 	# mvn test -Dtest=com.alibaba.graphscope.gremlin.integration.ldbc.IrLdbcTest
 	mvn test -Dtest=com.alibaba.graphscope.cypher.integration.ldbc.IrLdbcTest
 
+simple_test:
+	mvn test -Dtest=com.alibaba.graphscope.cypher.integration.ldbc.SimpleMatchTest
+
 # start rpc server
 # make run graph.schema:=../executor/ir/core/resource/ldbc_schema.json
 pattern_test:
diff --git a/interactive_engine/compiler/ir_experimental_advanced_ci.sh b/interactive_engine/compiler/ir_experimental_advanced_ci.sh
index 0cfbb89cf663..1804a2d4d430 100755
--- a/interactive_engine/compiler/ir_experimental_advanced_ci.sh
+++ b/interactive_engine/compiler/ir_experimental_advanced_ci.sh
@@ -4,6 +4,7 @@ base_dir=$(cd $(dirname $0); pwd)
 ps -ef | grep "com.alibaba.graphscope.GraphServer" | awk '{print $2}' | xargs kill -9 || true
 ps -ef | grep "start_rpc_server" |  awk '{print $2}' | xargs kill -9
 sleep 3
+# Test1: run advanced tests (pattern & ldbc) on experimental store via ir-core
 # start engine service and load ldbc graph with sf=0.1
 cd ${base_dir}/../executor/ir/target/release &&
 RUST_LOG=info DATA_PATH=/tmp/gstest/ldbc_graph_exp_bin PARTITION_ID=0 ./start_rpc_server --config ${base_dir}/../executor/ir/integrated/config/distributed/server_0 &
@@ -16,11 +17,32 @@ sleep 5
 # run pattern tests and ldbc tests
 cd ${base_dir} && make pattern_test && make ldbc_test
 exit_code=$?
+# clean compiler service
+ps -ef | grep "com.alibaba.graphscope.GraphServer" | awk '{print $2}' | xargs kill -9 || true
+ps -ef | grep "start_rpc_server" |  awk '{print $2}' | xargs kill -9
+sleep 3
+# report test result
+if [ $exit_code -ne 0 ]; then
+    echo "ir integration pattern test on experimental store fail"
+    exit 1
+fi
+
+# Test2: run advanced tests (pattern & ldbc & simple match) on experimental store via calcite-based ir
+# start service
+cd ${base_dir}/../executor/ir/target/release &&
+RUST_LOG=info DATA_PATH=/tmp/gstest/ldbc_graph_exp_bin PARTITION_ID=0 ./start_rpc_server --config ${base_dir}/../executor/ir/integrated/config/distributed/server_0 &
+cd ${base_dir}/../executor/ir/target/release &&
+RUST_LOG=info DATA_PATH=/tmp/gstest/ldbc_graph_exp_bin PARTITION_ID=1 ./start_rpc_server --config ${base_dir}/../executor/ir/integrated/config/distributed/server_1 &
+sleep 10
+cd ${base_dir} && make run graph.schema:=../executor/ir/core/resource/ldbc_schema.json gremlin.script.language.name=antlr_gremlin_calcite physical.opt.config=proto graph.planner.opt=CBO graph.statistics=src/main/resources/statistics/ldbc1_statistics.json pegasus.hosts:=127.0.0.1:1234,127.0.0.1:1235 graph.planner.rules=NotMatchToAntiJoinRule,FilterIntoJoinRule,FilterMatchRule,ExtendIntersectRule,ExpandGetVFusionRule &
+sleep 5s
+cd ${base_dir} && make pattern_test && make ldbc_test && make simple_test
+exit_code=$?
 # clean service
 ps -ef | grep "com.alibaba.graphscope.GraphServer" | awk '{print $2}' | xargs kill -9 || true
 ps -ef | grep "start_rpc_server" | awk '{print $2}' | xargs kill -9
 # report test result
 if [ $exit_code -ne 0 ]; then
-    echo "ir integration pattern test on experimental store fail"
+    echo "ir\(calcite-based\) integration pattern test on experimental store fail"
     exit 1
 fi
diff --git a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/cypher/integration/suite/simple/SimpleMatchQueries.java b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/cypher/integration/suite/simple/SimpleMatchQueries.java
index 0425062627d8..bfedfda21f49 100644
--- a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/cypher/integration/suite/simple/SimpleMatchQueries.java
+++ b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/cypher/integration/suite/simple/SimpleMatchQueries.java
@@ -186,11 +186,21 @@ public static QueryContext get_simple_match_query_15_test() {
 
         List<String> expected =
                 Arrays.asList(
-                        "Record<{aId: 94, c: path[], bId: 987}>",
-                        "Record<{aId: 94, c: path[], bId: 2199023256154}>",
-                        "Record<{aId: 94, c: path[], bId: 2199023256776}>",
-                        "Record<{aId: 94, c: path[], bId: 6597069767432}>",
-                        "Record<{aId: 94, c: path[], bId: 8796093022369}>");
+                        "Record<{aId: 94, c:"
+                                + " path[[(72057594037928030)-[771484:KNOWS]->(72057594037928923)],"
+                                + " bId: 987}>",
+                        "Record<{aId: 94, c:"
+                            + " path[(72057594037928030)-[771485:KNOWS]->(72059793061184090)], bId:"
+                            + " 2199023256154}>",
+                        "Record<{aId: 94, c:"
+                            + " path[(72057594037928030)-[771486:KNOWS]->(72059793061184712)], bId:"
+                            + " 2199023256776}>",
+                        "Record<{aId: 94, c:"
+                            + " path[(72057594037928030)-[771487:KNOWS]->(72064191107695368)], bId:"
+                            + " 6597069767432}>",
+                        "Record<{aId: 94, c:"
+                                + " path[(72057594037928030)-[771488:KNOWS]->(72066390130950305)]],"
+                                + " bId: 8796093022369}>");
         return new QueryContext(query, expected);
     }
 
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 aa18e7817d98..3801a968ad55 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
@@ -154,14 +154,6 @@
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasTest",
         method = "g_EX11X_outV_outE_hasXid_10AsStringX",
         reason = "unsupported")
-// @Graph.OptOut(
-//        test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsTest",
-//        method = "g_V_whereXinXcreatedX_count_isX1XX_valuesXnameX",
-//        reason = "unsupported")
-// @Graph.OptOut(
-//        test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsTest",
-//        method = "g_V_whereXinXcreatedX_count_isXgte_2XX_valuesXnameX",
-//        reason = "unsupported")
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.RangeTest",
         method = "g_V_outE_valuesXweightX_fold_orderXlocalX_skipXlocal_2X",
@@ -248,16 +240,14 @@
         method =
                 "g_withSideEffectXa_josh_peterX_VX1X_outXcreatedX_inXcreatedX_name_whereXwithinXaXX",
         reason = "unsupported")
-// @Graph.OptOut(test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest",
-//        method = "g_V_hasXageX_asXaX_out_in_hasXageX_asXbX_selectXa_bX_whereXa_outXknowsX_bX",
-//        reason = "unsupported")
+@Graph.OptOut(
+        test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest",
+        method = "g_V_hasXageX_asXaX_out_in_hasXageX_asXbX_selectXa_bX_whereXa_outXknowsX_bX",
+        reason = "unsupported")
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest",
         method = "g_V_whereXoutXcreatedX_and_outXknowsX_or_inXknowsXX_valuesXnameX",
         reason = "unsupported")
-// @Graph.OptOut(test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest",
-//        method = "g_V_whereXnotXoutXcreatedXXX_name",
-//        reason = "unsupported")
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest",
         method =
@@ -272,9 +262,6 @@
         method =
                 "g_V_asXaX_outEXcreatedX_asXbX_inV_asXcX_inXcreatedX_asXdX_whereXa_ltXbX_orXgtXcXX_andXneqXdXXX_byXageX_byXweightX_byXinXcreatedX_valuesXageX_minX_selectXa_c_dX",
         reason = "unsupported")
-// @Graph.OptOut(test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest",
-//        method = "g_V_hasXageX_asXaX_out_in_hasXageX_asXbX_selectXa_bX_whereXb_hasXname_markoXX",
-//        reason = "unsupported")
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest",
         method = "g_VX1X_out_aggregateXxX_out_whereXnotXwithinXaXXX",
@@ -303,10 +290,6 @@
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.CountTest",
         method = "g_V_both_both_count",
         reason = "unsupported")
-// @Graph.OptOut(
-//        test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.CountTest",
-//        method = "g_V_whereXinXkknowsX_outXcreatedX_count_is_0XX_name",
-//        reason = "unsupported")
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphTest",
         method = "g_V_hasLabelXpersonX_asXpX_VXsoftwareX_addInEXuses_pX",
@@ -383,10 +366,6 @@
 // @Graph.OptOut(test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.OrderTest",
 //        method = "g_V_order_byXname_incrX_name",
 //        reason = "unsupported")
-// @Graph.OptOut(
-//        test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.OrderTest",
-//        method = "g_V_order_byXoutE_count_descX",
-//        reason = "unsupported")
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.OrderTest",
         method = "g_V_order_byXname_a1_b1X_byXname_b2_a2X_name",
@@ -668,10 +647,6 @@
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupTest",
         method = "g_V_hasXlangX_groupXaX_byXlangX_byXnameX_out_capXaX",
         reason = "unsupported")
-// @Graph.OptOut(
-//        test = "org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupTest",
-//        method = "g_V_group_byXoutE_countX_byXnameX",
-//        reason = "unsupported")
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupTest",
         method = "g_V_groupXaX_byXlabelX_byXoutE_weight_sumX_capXaX",
@@ -686,10 +661,6 @@
         method =
                 "g_V_unionXrepeatXoutX_timesX2X_groupCountXmX_byXlangXX__repeatXinX_timesX2X_groupCountXmX_byXnameXX_capXmX",
         reason = "unsupported")
-// @Graph.OptOut(
-//        test = "org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupCountTest",
-//        method = "g_V_groupCount_byXbothE_countX",
-//        reason = "unsupported")
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupCountTest",
         method = "g_V_repeatXout_groupCountXaX_byXnameXX_timesX2X_capXaX",
@@ -858,7 +829,7 @@
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.DedupTest",
         method = "g_V_both_both_dedup_byXoutE_countX_name",
-        reason = "unsupported")
+        reason = "tested in IrGremlinQueryTest")
 // @Graph.OptOut(
 //        test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.DedupTest",
 //        method = "g_V_asXaX_both_asXbX_dedupXa_bX_byXlabelX_selectXa_bX",
@@ -1020,7 +991,7 @@
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasTest",
         method = "g_E_hasXlabelXknowsX",
-        reason = "Tested in IrGremlinQueryTest")
+        reason = "tested in IrGremlinQueryTest")
 // @Graph.OptOut(
 //        test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexTest",
 //        method = "g_VX2X_inE",
@@ -1212,9 +1183,6 @@
 // @Graph.OptOut(method="g_VX1X_asXaX_outXcreatedX_inXcreatedX_asXbX_whereXa_neqXbXX_name" ,
 // test="org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest", reason = "will be
 // supported")
-// @Graph.OptOut(method="g_V_asXaX_outXcreatedX_whereXasXaX_name_isXjoshXX_inXcreatedX_name" ,
-// test="org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest", reason = "will be
-// supported")
 // @Graph.OptOut(method="g_V_asXaX_outXcreatedX_asXbX_inXcreatedX_asXcX_bothXknowsX_bothXknowsX_asXdX_whereXc__notXeqXaX_orXeqXdXXXX_selectXa_b_c_dX" , test="org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest", reason = "will be supported")
 // @Graph.OptOut(method="g_V_asXaX_outXcreatedX_inXcreatedX_asXbX_whereXa_gtXbXX_byXageX_selectXa_bX_byXnameX" , test="org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest", reason = "will be supported")
 // @Graph.OptOut(method="g_V_hasLabelXpersonX_order_byXageX" ,
@@ -1257,9 +1225,6 @@
 // @Graph.OptOut(method="g_V_asXaX_name_order_asXbX_selectXa_bX_byXnameX_by_XitX" ,
 // test="org.apache.tinkerpop.gremlin.process.traversal.step.map.SelectTest", reason = "will be
 // supported")
-// @Graph.OptOut(method="g_V_asXaX_whereXoutXknowsXX_selectXaX" ,
-// test="org.apache.tinkerpop.gremlin.process.traversal.step.map.SelectTest", reason = "will be
-// supported")
 @Graph.OptOut(
         method = "g_EX11X_propertiesXweightX_asXaX_selectXaX_byXvalueX",
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.SelectTest",
@@ -1314,7 +1279,7 @@
 @Graph.OptOut(
         method = "g_V_group_byXageX",
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupTest",
-        reason = "tinkerpop v3.5 takes null key into account, but later version filter null key")
+        reason = "tested in IrGremlinQueryTest")
 
 // @Graph.OptOut(method="g_V_hasXp_neqXvXX" ,
 // test="org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasTest", reason = "existence of
@@ -1537,15 +1502,11 @@
 @Graph.OptOut(
         method = "g_V_unionXout__inX_name",
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.branch.UnionTest",
-        reason = "Tested in IrGremlinQueryTest")
+        reason = "tested in IrGremlinQueryTest")
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.branch.UnionTest",
         method = "g_VX1_2X_unionXoutE_count__inE_count__outE_weight_sumX",
-        reason = "Tested in IrGremlinQueryTest")
-// @Graph.OptOut(
-//        method = "g_V_haslabel_union_identity_out_values",
-//        test = "com.alibaba.graphscope.gremlin.integration.suite.standard.IrGremlinQueryTest",
-//        reason = "union is unsupported yet")
+        reason = "tested in IrGremlinQueryTest")
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasTest",
         method = "g_V_hasLabelXpersonX_hasLabelXsoftwareX",
@@ -1553,51 +1514,51 @@
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsTest",
         method = "g_V_whereXinXcreatedX_count_isX1XX_valuesXnameX",
-        reason = "sub query is unsupported yet")
+        reason = "tested in IrGremlinQueryTest")
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsTest",
         method = "g_V_whereXinXcreatedX_count_isXgte_2XX_valuesXnameX",
-        reason = "sub query is unsupported yet")
-@Graph.OptOut(
-        test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest",
-        method = "g_V_hasXageX_asXaX_out_in_hasXageX_asXbX_selectXa_bX_whereXa_outXknowsX_bX",
-        reason = "sub query is unsupported yet")
+        reason = "tested in IrGremlinQueryTest")
+// @Graph.OptOut(
+//         test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest",
+//         method = "g_V_hasXageX_asXaX_out_in_hasXageX_asXbX_selectXa_bX_whereXa_outXknowsX_bX",
+//         reason = "sub query is unsupported yet")
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest",
         method = "g_V_whereXnotXoutXcreatedXXX_name",
-        reason = "sub query is unsupported yet")
+        reason = "tested in IrGremlinQueryTest")
 @Graph.OptOut(
         method = "g_V_asXaX_outXcreatedX_whereXasXaX_name_isXjoshXX_inXcreatedX_name",
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest",
-        reason = "sub query is unsupported yet")
+        reason = "tested in IrGremlinQueryTest")
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest",
         method = "g_V_hasXageX_asXaX_out_in_hasXageX_asXbX_selectXa_bX_whereXb_hasXname_markoXX",
-        reason = "sub query is unsupported yet")
+        reason = "tested in IrGremlinQueryTest")
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.CountTest",
         method = "g_V_whereXinXkknowsX_outXcreatedX_count_is_0XX_name",
-        reason = "sub query is unsupported yet")
+        reason = "tested in IrGremlinQueryTest")
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.OrderTest",
         method = "g_V_order_byXoutE_count_descX",
-        reason = "sub query is unsupported yet")
+        reason = "tested in IrGremlinQueryTest")
 @Graph.OptOut(
         test = "com.alibaba.graphscope.gremlin.integration.suite.standard.IrGremlinQueryTest",
         method = "g_V_group_by_outE_count_test",
-        reason = "sub query is unsupported yet")
+        reason = "tested in IrGremlinQueryTest")
 @Graph.OptOut(
         method = "g_V_asXaX_whereXoutXknowsXX_selectXaX",
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.SelectTest",
-        reason = "sub query is unsupported yet")
+        reason = "tested in IrGremlinQueryTest")
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupTest",
         method = "g_V_group_byXoutE_countX_byXnameX",
-        reason = "sub query is unsupported yet")
+        reason = "tested in IrGremlinQueryTest")
 @Graph.OptOut(
         test = "org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupCountTest",
         method = "g_V_groupCount_byXbothE_countX",
-        reason = "sub query is unsupported yet")
+        reason = "tested in IrGremlinQueryTest")
 @Graph.OptOut(
         method =
                 "g_VX1X_outEXknowsX_asXhereX_hasXweight_1X_asXfakeX_inV_hasXname_joshX_selectXhereX",
diff --git a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/suite/pattern/PatternQueryTest.java b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/suite/pattern/PatternQueryTest.java
index d681f6cd9263..518e48ca2b61 100644
--- a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/suite/pattern/PatternQueryTest.java
+++ b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/suite/pattern/PatternQueryTest.java
@@ -23,6 +23,7 @@
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.junit.Assert;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import java.util.Map;
@@ -162,6 +163,7 @@ public void run_pattern_8_test() {
         Assert.assertEquals(1247146L, traversal.next().longValue());
     }
 
+    @Ignore("Have not supported pattern with multi-edges yet")
     @Test
     public void run_pattern_9_test() {
         Traversal<Vertex, Long> traversal = this.get_pattern_9_test();
@@ -169,6 +171,7 @@ public void run_pattern_9_test() {
         Assert.assertEquals(23286L, traversal.next().longValue());
     }
 
+    @Ignore("Have not supported pattern with multi-edges yet")
     @Test
     public void run_pattern_9b_test() {
         Traversal<Vertex, Long> traversal = this.get_pattern_9b_test();
diff --git a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/suite/standard/IrGremlinQueryTest.java b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/suite/standard/IrGremlinQueryTest.java
index 1e6c346c0bbc..2a5631cb0ea4 100644
--- a/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/suite/standard/IrGremlinQueryTest.java
+++ b/interactive_engine/compiler/src/main/java/com/alibaba/graphscope/gremlin/integration/suite/standard/IrGremlinQueryTest.java
@@ -171,6 +171,32 @@ public abstract class IrGremlinQueryTest extends AbstractGremlinProcessTest {
     public abstract Traversal<Vertex, Object>
             get_g_V_where_expr_name_equal_marko_and_age_gt_20_or_age_lt_10_name();
 
+    public abstract Traversal<Vertex, String> get_g_V_both_both_dedup_byXoutE_countX_name();
+
+    public abstract Traversal<Vertex, String> get_g_V_whereXinXcreatedX_count_isX1XX_valuesXnameX();
+
+    public abstract Traversal<Vertex, String>
+            get_g_V_whereXinXcreatedX_count_isXgte_2XX_valuesXnameX();
+
+    public abstract Traversal<Vertex, String>
+            get_g_V_asXaX_outXcreatedX_whereXasXaX_name_isXjoshXX_inXcreatedX_name();
+
+    public abstract Traversal<Vertex, String> get_g_V_whereXnotXoutXcreatedXXX_name();
+
+    public abstract Traversal<Vertex, String>
+            get_g_V_whereXinXknowsX_outXcreatedX_count_is_0XX_name();
+
+    public abstract Traversal<Vertex, Vertex> get_g_V_order_byXoutE_count_descX();
+
+    public abstract Traversal<Vertex, Vertex> get_g_V_asXaX_whereXoutXknowsXX_selectXaX();
+
+    public abstract Traversal<Vertex, Map<Long, Long>> get_g_V_groupCount_byXbothE_countX();
+
+    public abstract Traversal<Vertex, Map<Long, Collection<String>>>
+            get_g_V_group_byXoutE_countX_byXnameX();
+
+    public abstract Traversal<Vertex, Map<Integer, Collection<Vertex>>> get_g_V_group_byXageX();
+
     public abstract Traversal<Vertex, Object> get_g_V_path_expand_until_age_gt_30_values_age();
 
     @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
@@ -225,6 +251,55 @@ public void g_V_where_expr_name_equal_marko_and_age_gt_20_or_age_lt_10_name() {
         Assert.assertEquals("marko", traversal.next());
     }
 
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_V_both_both_dedup_byXoutE_countX_name() {
+        assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE")));
+        final Traversal<Vertex, String> traversal = get_g_V_both_both_dedup_byXoutE_countX_name();
+        printTraversalForm(traversal);
+        final List<String> names = traversal.toList();
+        assertEquals(4, names.size());
+        assertTrue(names.contains("josh"));
+        assertTrue(names.contains("peter"));
+        assertTrue(names.contains("marko"));
+        // the 4th is vadas, ripple, or lop
+        assertEquals(4, new HashSet<>(names).size());
+    }
+
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_V_whereXinXcreatedX_count_isX1XX_valuesXnameX() {
+        assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE")));
+        final Traversal<Vertex, String> traversal =
+                get_g_V_whereXinXcreatedX_count_isX1XX_valuesXnameX();
+        printTraversalForm(traversal);
+        assertTrue(traversal.hasNext());
+        assertEquals("ripple", traversal.next());
+        assertFalse(traversal.hasNext());
+    }
+
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_V_whereXinXcreatedX_count_isXgte_2XX_valuesXnameX() {
+        assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE")));
+        final Traversal<Vertex, String> traversal =
+                get_g_V_whereXinXcreatedX_count_isXgte_2XX_valuesXnameX();
+        printTraversalForm(traversal);
+        assertTrue(traversal.hasNext());
+        assertEquals("lop", traversal.next());
+        assertFalse(traversal.hasNext());
+    }
+
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_V_asXaX_outXcreatedX_whereXasXaX_name_isXjoshXX_inXcreatedX_name() {
+        assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE")));
+        final Traversal<Vertex, String> traversal =
+                get_g_V_asXaX_outXcreatedX_whereXasXaX_name_isXjoshXX_inXcreatedX_name();
+        printTraversalForm(traversal);
+        checkResults(Arrays.asList("marko", "josh", "peter", "josh"), traversal);
+    }
+
     public abstract Traversal<Vertex, Long> get_g_V_where_out_out_count();
 
     public abstract Traversal<Vertex, Long> get_g_V_where_not_out_out_count();
@@ -1134,6 +1209,128 @@ public void g_E_hasLabelXknowsX() {
         Assert.assertEquals(2, counter);
     }
 
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_V_whereXnotXoutXcreatedXXX_name() {
+        assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE")));
+        final Traversal<Vertex, String> traversal = get_g_V_whereXnotXoutXcreatedXXX_name();
+        printTraversalForm(traversal);
+        checkResults(Arrays.asList("vadas", "lop", "ripple"), traversal);
+    }
+
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_V_whereXinXkknowsX_outXcreatedX_count_is_0XX_name() {
+        assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE")));
+        final Traversal<Vertex, String> traversal =
+                get_g_V_whereXinXknowsX_outXcreatedX_count_is_0XX_name();
+        printTraversalForm(traversal);
+        checkResults(Arrays.asList("marko", "lop", "ripple", "peter"), traversal);
+    }
+
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_V_order_byXoutE_count_descX() {
+        assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE")));
+        Arrays.asList(get_g_V_order_byXoutE_count_descX())
+                .forEach(
+                        traversal -> {
+                            printTraversalForm(traversal);
+                            final List<Vertex> vertices = traversal.toList();
+                            assertEquals(vertices.size(), 6);
+                            assertEquals("marko", vertices.get(0).value("name"));
+                            assertEquals("josh", vertices.get(1).value("name"));
+                            assertEquals("peter", vertices.get(2).value("name"));
+                            assertTrue(
+                                    vertices.get(3).value("name").equals("vadas")
+                                            || vertices.get(3).value("name").equals("ripple")
+                                            || vertices.get(3).value("name").equals("lop"));
+                            assertTrue(
+                                    vertices.get(4).value("name").equals("vadas")
+                                            || vertices.get(4).value("name").equals("ripple")
+                                            || vertices.get(4).value("name").equals("lop"));
+                            assertTrue(
+                                    vertices.get(5).value("name").equals("vadas")
+                                            || vertices.get(5).value("name").equals("ripple")
+                                            || vertices.get(5).value("name").equals("lop"));
+                        });
+    }
+
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_V_asXaX_whereXoutXknowsXX_selectXaX() {
+        assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE")));
+        final Traversal<Vertex, Vertex> traversal = get_g_V_asXaX_whereXoutXknowsXX_selectXaX();
+        printTraversalForm(traversal);
+        assertEquals(convertToVertex(graph, "marko"), traversal.next());
+        assertFalse(traversal.hasNext());
+    }
+
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_V_groupCount_byXbothE_countX() {
+        assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE")));
+        final Traversal<Vertex, Map<Long, Long>> traversal = get_g_V_groupCount_byXbothE_countX();
+        printTraversalForm(traversal);
+        checkMap(
+                new HashMap<Long, Long>() {
+                    {
+                        put(1L, 3L);
+                        put(3L, 3L);
+                    }
+                },
+                traversal.next());
+        checkSideEffects(traversal.asAdmin().getSideEffects());
+    }
+
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_V_group_byXoutE_countX_byXnameX() {
+        assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE")));
+        final Traversal<Vertex, Map<Long, Collection<String>>> traversal =
+                get_g_V_group_byXoutE_countX_byXnameX();
+        printTraversalForm(traversal);
+        assertTrue(traversal.hasNext());
+        final Map<Long, Collection<String>> map = traversal.next();
+        assertFalse(traversal.hasNext());
+        assertEquals(4, map.size());
+        assertTrue(map.containsKey(0L));
+        assertTrue(map.containsKey(1L));
+        assertTrue(map.containsKey(2L));
+        assertTrue(map.containsKey(3L));
+        assertEquals(3, map.get(0L).size());
+        assertEquals(1, map.get(1L).size());
+        assertEquals(1, map.get(2L).size());
+        assertEquals(1, map.get(3L).size());
+        assertTrue(map.get(0L).contains("lop"));
+        assertTrue(map.get(0L).contains("ripple"));
+        assertTrue(map.get(0L).contains("vadas"));
+        assertTrue(map.get(1L).contains("peter"));
+        assertTrue(map.get(2L).contains("josh"));
+        assertTrue(map.get(3L).contains("marko"));
+        checkSideEffects(traversal.asAdmin().getSideEffects());
+    }
+
+    @Test
+    @LoadGraphWith(MODERN)
+    public void g_V_group_byXageX() {
+        assumeFalse("hiactor".equals(System.getenv("ENGINE_TYPE")));
+        final Traversal<Vertex, Map<Integer, Collection<Vertex>>> traversal =
+                get_g_V_group_byXageX();
+        printTraversalForm(traversal);
+
+        final Map<Integer, Collection<Vertex>> map = traversal.next();
+        assertEquals(5, map.size());
+        map.forEach(
+                (key, values) -> {
+                    if (null == key) assertEquals(2, values.size());
+                    else assertEquals(1, values.size());
+                });
+        assertFalse(traversal.hasNext());
+
+        checkSideEffects(traversal.asAdmin().getSideEffects());
+    }
+
     public static class Traversals extends IrGremlinQueryTest {
 
         // g.V().out().union(out(), in(), in()).count()
@@ -1572,5 +1769,66 @@ public Traversal<Edge, Edge> get_g_E_hasLabelXknowsX() {
                     .select("a", "b")
                     .where(as("b").has("name", "marko"));
         }
+
+        @Override
+        public Traversal<Vertex, String> get_g_V_both_both_dedup_byXoutE_countX_name() {
+            return g.V().both().both().dedup().by(__.outE().count()).values("name");
+        }
+
+        @Override
+        public Traversal<Vertex, String> get_g_V_whereXinXcreatedX_count_isX1XX_valuesXnameX() {
+            return g.V().where(in("created").count().is(1)).values("name");
+        }
+
+        @Override
+        public Traversal<Vertex, String> get_g_V_whereXinXcreatedX_count_isXgte_2XX_valuesXnameX() {
+            return g.V().where(in("created").count().is(P.gte(2L))).values("name");
+        }
+
+        @Override
+        public Traversal<Vertex, String>
+                get_g_V_asXaX_outXcreatedX_whereXasXaX_name_isXjoshXX_inXcreatedX_name() {
+            return g.V().as("a")
+                    .out("created")
+                    .where(as("a").values("name").is("josh"))
+                    .in("created")
+                    .values("name");
+        }
+
+        @Override
+        public Traversal<Vertex, String> get_g_V_whereXnotXoutXcreatedXXX_name() {
+            return g.V().where(not(out("created"))).values("name");
+        }
+
+        @Override
+        public Traversal<Vertex, String> get_g_V_whereXinXknowsX_outXcreatedX_count_is_0XX_name() {
+            return g.V().where(in("knows").out("created").count().is(0)).values("name");
+        }
+
+        @Override
+        public Traversal<Vertex, Vertex> get_g_V_order_byXoutE_count_descX() {
+            return g.V().order().by(outE().count(), Order.desc);
+        }
+
+        @Override
+        public Traversal<Vertex, Vertex> get_g_V_asXaX_whereXoutXknowsXX_selectXaX() {
+            return g.V().as("a").where(__.out("knows")).<Vertex>select("a");
+        }
+
+        @Override
+        public Traversal<Vertex, Map<Long, Long>> get_g_V_groupCount_byXbothE_countX() {
+            return g.V().<Long>groupCount().by(bothE().count());
+        }
+
+        @Override
+        public Traversal<Vertex, Map<Long, Collection<String>>>
+                get_g_V_group_byXoutE_countX_byXnameX() {
+            return g.V().<Long, Collection<String>>group().by(outE().count()).by("name");
+        }
+
+        @Override
+        public Traversal<Vertex, Map<Integer, Collection<Vertex>>> get_g_V_group_byXageX() {
+            return g.V().<Integer, Collection<Vertex>>group().by("age");
+        }
     }
 }


Test patch:
diff --git a/interactive_engine/compiler/src/test/java/com/alibaba/graphscope/cypher/integration/ldbc/SimpleMatchTest.java b/interactive_engine/compiler/src/test/java/com/alibaba/graphscope/cypher/integration/ldbc/SimpleMatchTest.java
index fd10f8df16b3..ea20d0823c09 100644
--- a/interactive_engine/compiler/src/test/java/com/alibaba/graphscope/cypher/integration/ldbc/SimpleMatchTest.java
+++ b/interactive_engine/compiler/src/test/java/com/alibaba/graphscope/cypher/integration/ldbc/SimpleMatchTest.java
@@ -15,6 +15,8 @@
  */
 package com.alibaba.graphscope.cypher.integration.ldbc;
 
+import static org.junit.Assume.assumeTrue;
+
 import com.alibaba.graphscope.cypher.integration.suite.QueryContext;
 import com.alibaba.graphscope.cypher.integration.suite.simple.SimpleMatchQueries;
 
@@ -39,6 +41,7 @@ public static void beforeClass() {
 
     @Test
     public void run_simple_match_1_test() {
+        assumeTrue("hiactor".equals(System.getenv("ENGINE_TYPE")));
         QueryContext testQuery = SimpleMatchQueries.get_simple_match_query_1_test();
         Result result = session.run(testQuery.getQuery());
         Assert.assertEquals(testQuery.getExpectedResult().toString(), result.list().toString());
@@ -130,6 +133,8 @@ public void run_simple_match_13_test() {
 
     @Test
     public void run_simple_match_14_test() {
+        // TODO: fix this in hiactor.
+        assumeTrue("pegasus".equals(System.getenv("ENGINE_TYPE")));
         QueryContext testQuery = SimpleMatchQueries.get_simple_match_query_14_test();
         Result result = session.run(testQuery.getQuery());
         Assert.assertEquals(testQuery.getExpectedResult().toString(), result.list().toString());
@@ -137,6 +142,8 @@ public void run_simple_match_14_test() {
 
     @Test
     public void run_simple_match_15_test() {
+        // TODO: fix this in hiactor.
+        assumeTrue("pegasus".equals(System.getenv("ENGINE_TYPE")));
         QueryContext testQuery = SimpleMatchQueries.get_simple_match_query_15_test();
         Result result = session.run(testQuery.getQuery());
         Assert.assertEquals(testQuery.getExpectedResult().toString(), result.list().toString());