[
https://issues.apache.org/jira/browse/TINKERPOP-2606?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stephen Mallette closed TINKERPOP-2606.
---------------------------------------
Fix Version/s: 3.6.0
Assignee: Stephen Mallette
Resolution: Done
> Neo4j-Gremlin could not order vertex/edge without specified property
> --------------------------------------------------------------------
>
> Key: TINKERPOP-2606
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2606
> Project: TinkerPop
> Issue Type: Bug
> Components: neo4j
> Affects Versions: 3.4.10
> Environment: Tinkerpop Version : 3.4.10
> Neo4j Version : 3.5.27
> OS : CentOS8
> Storage Backend: in-memory
> Reporter: GrandA
> Assignee: Stephen Mallette
> Priority: Major
> Fix For: 3.6.0
>
>
> h2. Neo4j-Gremlin could not order vertex/edge without specified property
> h3. Environment
> Tinkerpop Version : 3.4.10
> Neo4j Version : 3.5.27
> OS : CentOS8
> Storage Backend: in-memory
> Data size: 100 vertices, 200 edges
> h4. 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 Neo4j-Gremlin, as we can get the
> result by the same query in JanusGraph.
> h4. Current behavior
> An exception was thrown:
> {code:java}
> java.util.concurrent.ExecutionException:
> org.apache.tinkerpop.gremlin.driver.exception.ResponseException:
> org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex cannot be cast to
> java.lang.Comparablejava.util.concurrent.ExecutionException:
> org.apache.tinkerpop.gremlin.driver.exception.ResponseException:
> org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex 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.ValidateNeo4jOrderAsc.main(ValidateNeo4jOrderAsc.java:30)Caused
> by: org.apache.tinkerpop.gremlin.driver.exception.ResponseException:
> org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex cannot be cast to
> java.lang.Comparable
> {code}
> h3. Reproduce
> {code:java}
> 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);
> }
> {code}
> We could successfully run the order() step with specified property in
> Neo4j-Gremlin, 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 Neo4j-Gremlin.
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)