Skip to content
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 @@ -1390,10 +1390,11 @@ public static void extractRange(Step<?, ?> newStep,
traversal, 0, limit);
TraversalHelper.replaceStep(range, newRange, traversal);
}
// Only the first range is in the backend query's coordinates.
// Later ranges apply to the already-limited stream, so keep them as local steps.
break;
}
} while (step instanceof RangeGlobalStep ||
step instanceof IdentityStep ||
step instanceof NoOpBarrierStep);
} while (step instanceof IdentityStep || step instanceof NoOpBarrierStep);
}

public static void extractCount(Step<?, ?> newStep,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3738,6 +3738,22 @@ public void testLocalEdgeIdAndLabelRepresentations() {
}
}

@Test
public void testQueryOutVerticesWithRangesSeparatedByBarrier() {
HugeGraph graph = graph();
init100LookEdges();

Vertex louise = vertex("person", "name", "Louise");

List<Vertex> vertices = graph.traversal().V(louise.id())
.out("look")
.range(2, 3)
.barrier()
.range(0, 1)
.toList();
Assert.assertEquals(1, vertices.size());
}

@Test
public void testQueryEdgesByNonEqLabelAndIndexedPropertyAcrossBarrier() {
HugeGraph graph = graph();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3081,6 +3081,18 @@ public void testQueryAllWithOffsetAndLimitWithMultiTimes() {
Assert.assertEquals(0, vertices.size());
}

@Test
public void testQueryAllWithRangesSeparatedByBarrier() {
HugeGraph graph = graph();
this.init10VerticesAndCommit();

List<Vertex> vertices = graph.traversal().V().range(2, 3).barrier().range(0, 1).toList();
Assert.assertEquals(1, vertices.size());

vertices = graph.traversal().V().range(1, 6).barrier().range(3, 8).toList();
Assert.assertEquals(2, vertices.size());
}

@Test
public void testQueryAllWithIllegalOffsetOrLimit() {
HugeGraph graph = graph();
Expand Down
Loading