[ 
https://issues.apache.org/jira/browse/TINKERPOP3-941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15023421#comment-15023421
 ] 

ASF GitHub Bot commented on TINKERPOP3-941:
-------------------------------------------

Github user twilmes commented on the pull request:

    
https://github.com/apache/incubator-tinkerpop/pull/155#issuecomment-159109545
  
    Tests all ran fine.  I did run into an issue trying the decr behavior.  
Query with modern graph was:
    ```
    gremlin> g.V().hasLabel("person").order().by("age", valueDecr)
    java.lang.Integer cannot be cast to java.util.Map$Entry
    Display stack trace? [yN] y
    java.lang.ClassCastException: java.lang.Integer cannot be cast to 
java.util.Map$Entry
        at 
org.apache.tinkerpop.gremlin.process.traversal.Order$6.compare(Order.java:83)
        at 
org.apache.tinkerpop.gremlin.process.traversal.step.util.ElementValueComparator.compare(ElementValueComparator.java:49)
        at 
org.apache.tinkerpop.gremlin.process.traversal.step.util.ElementValueComparator.compare(ElementValueComparator.java:29)
        at 
org.apache.tinkerpop.gremlin.process.traversal.step.map.OrderGlobalStep$ComparatorTraverser.compare(OrderGlobalStep.java:123)
        at 
org.apache.tinkerpop.gremlin.process.traversal.step.map.OrderGlobalStep$ComparatorTraverser.compare(OrderGlobalStep.java:113)
        at 
org.apache.tinkerpop.gremlin.util.function.ChainedComparator.compare(ChainedComparator.java:42)
    ```
    
    It works if I do `order(local)` but I expected it to behave the same way 
your test for the incrementing version worked 
`g.V().hasLabel("person").order().by("age")`


> Improve error message for wrong order().by() arguments
> ------------------------------------------------------
>
>                 Key: TINKERPOP3-941
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-941
>             Project: TinkerPop 3
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.0.2-incubating
>            Reporter: Daniel Kuppitz
>            Assignee: Marko A. Rodriguez
>             Fix For: 3.1.1-incubating
>
>
> The traversal {code}g.V(hercules).local(__.outE().order().by("lala")){code} 
> throws the following exception:
> {noformat}
> java.lang.UnsupportedOperationException: Use 
> OrderGlobalStep.addComparator(TraversalComparator) to add a local child 
> traversal:OrderGlobalStep
> at 
> org.apache.tinkerpop.gremlin.process.traversal.step.map.OrderGlobalStep.addLocalChild(OrderGlobalStep.java:98)
> at 
> org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal.by(GraphTraversal.java:1016)
> at 
> org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal.by(GraphTraversal.java:1033)`
> {noformat}
> If you ran into this exception a few times, you'll know how easy it is to fix 
> that, but I concur with [~mbroecheler] when he says that this message is 
> really confusing. Users won't realize that they need to add {{incr}} or 
> {{decr}} as a second argument in {{by()}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to