[
https://issues.apache.org/jira/browse/TINKERPOP3-941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15023235#comment-15023235
]
ASF GitHub Bot commented on TINKERPOP3-941:
-------------------------------------------
GitHub user okram opened a pull request:
https://github.com/apache/incubator-tinkerpop/pull/155
TINKERPOP3-941: Improve error message for wrong order().by() arguments
https://issues.apache.org/jira/browse/TINKERPOP3-941
Instead of fixing the error message, I simply made it such that if you
don't provide a comparator, it assumes you mean `Order.incr`. Added a test for
both `OrderLocalStep` and `OrderGlobalStep` that demonstrate things working.
Finally, I also realized we didn't have a proper `clone()` method for
`OrderLobalStep`. Eek! Added it.
Ran `mvn clean install` and `SparkGraphComputerIntegrationTest` (for
`OrderTest` only) and all is golden.
VOTE +1.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/incubator-tinkerpop TINKERPOP3-941
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-tinkerpop/pull/155.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #155
----
commit 5231a7195fc8bdcecff89e7c4e965cf173883c65
Author: Marko A. Rodriguez <[email protected]>
Date: 2015-11-23T22:27:21Z
added support for order().by('age'). If you don't provide a Comparator,
Order.incr is assumed. Thus, no more error message about
OrderGlobalStep.addComparator(). Also, the test case I added demonstrated that
TINKERPOP3-979 passes with Spark... uh...thus, the ticket is invalid. I don't
know what caused the Spark error I got. Will close that ticket.
----
> 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)