lokidundun commented on code in PR #2982:
URL: https://github.com/apache/hugegraph/pull/2982#discussion_r3356928576


##########
hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/core/EdgeCoreTest.java:
##########
@@ -2683,6 +2683,28 @@ public void testQueryEdgesByIdWithGraphAPI() {
         Assert.assertEquals(2, edges.size());
     }
 
+    @Test
+    public void testQueryEdgesByNonConsecutiveDuplicateIds() {
+        HugeGraph graph = graph();
+        init18Edges();
+
+        List<Edge> allEdges = graph.traversal().E().toList();
+        Assert.assertTrue("need at least 2 edges", allEdges.size() >= 2);
+
+        Object id1 = allEdges.get(0).id();
+        Object id2 = allEdges.get(1).id();
+
+        // Graph API does not guarantee duplicate results for duplicate ids
+        List<Edge> edges = ImmutableList.copyOf(graph.edges(id1, id2, id1));
+        Assert.assertTrue(edges.size() >= 2);

Review Comment:
   在 IdQuery.query(Id) 只跳过连续重复(和上一个相同的 ID)。[id1, id2, id1] 中第二个 id1 的上一个是 
id2,不相等,所以没被跳过,query.idsSize() 返回 3,跟 ids.size() 相等,快路径被误触发。ci 无法通过
   



-- 
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]

Reply via email to