Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.4.10
-
None
-
Version: 3.4.10
OS : CentOS8
Storage Backend: in-memory
Description
TinkerGraph could not order vertex/edge without specified property
Environment
Version: 3.4.10
OS : CentOS8
Storage Backend: in-memory
Bug description
We expect to get the vertexes/edges ordered by their ID using gremlin order query without specified property like `"g.V()/E().order().by(asc/desc)"` in TinkerGraph, as we can get the result by the same query in JanusGraph.
Current behavior
An exception was thrown:
java.util.concurrent.ExecutionException: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerVertex cannot be cast to java.lang.Comparable at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357) at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1908) at org.gdbtesting.validation.ValidateTinkerOrderAsc.main(ValidateTinkerOrderAsc.java:27) Caused by: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerVertex cannot be cast to java.lang.Comparable
Reproduce
GraphTraversalSource g = connection.getG(); g.E().drop().iterate(); g.V().drop().iterate(); try { Vertex v1 = g.addV().property("price",3).next(); Vertex v2 = g.addV().property("price",4).next(); Vertex v3 = g.addV().property("price",5).next(); Vertex v4 = g.addV().property("price",6).next(); String query = "g.V().order().by(asc)"; System.out.println("query: " + query); try{ List<Result> results; results = connection.getClient().submit(query).all().get(); for (Result r : results) { System.out.println(r); } }catch(Exception e){ e.printStackTrace(); } } catch (Exception e) { e.printStackTrace(); } finally { System.exit(0); }
We could successfully run the order() step with specified property in TinkerGraph, like using "g.V().id().order().by(asc)" to get vertexes ordered by vertex ID. We bring up the issue for we are wondering whether query without specified property, like "g.V()/E().order().by(asc/desc)", is grammatically correct or not, as we find it could be accepted in JanusGraph while get exception above in TinkerGraph.
Attachments
Issue Links
- is related to
-
TINKERPOP-2606 Neo4j-Gremlin could not order vertex/edge without specified property
- Closed