Closed pietermartin closed 3 years ago
@Test public void testOptionalWithSelect() { Vertex car1 = this.sqlgGraph.addVertex(T.label, "Car"); Vertex car2 = this.sqlgGraph.addVertex(T.label, "Car"); Vertex person = this.sqlgGraph.addVertex(T.label, "Person"); car1.addEdge("passenger", person); this.sqlgGraph.tx().commit(); List<Path> paths = this.sqlgGraph.traversal().V().hasLabel("Car").as("cars") .optional( __.out("passenger").as("passenger") ) .path() .toList(); for (Path path : paths) { for (int i = 0; i < path.objects().size(); i++) { Object o = path.objects().get(i); Set<String> labels = path.labels().get(i); System.out.print(o + " " + labels.toString()); } System.out.println(); } List<Map<String, Vertex>> result = this.sqlgGraph.traversal().V().hasLabel("Car").as("cars") .optional( __.out("passenger").as("passenger") ) .<Vertex>select("cars", "passenger") .toList(); System.out.println(result); }
This select query returns nothing and TinkerPop something.
select
No longer happens on 2.0.3-SNAPSHOT on branch 2020
2.0.3-SNAPSHOT
2020
This
select
query returns nothing and TinkerPop something.