JanusGraph / JanusGraph/janusgraph
Unexpected exception when sort vertices or edges without ProductiveByStrategy
- Dominant language
- Java
- Stars
- 5.8k
- Forks
- 1.2k
- Avg merge
- 13h 53m
- Merged PRs (30d)
- 6
Description
For confirmed bugs, please report:
- Version: 0.6.3
- Storage Backend: inmemory
- Mixed Index Backend: none
- Link to discussed bug:
- Expected Behavior: We want to get the same query result when sorting the edges even if we remove `ProductiveByStrategy`.
- Current Behavior: it throws an unexpected exception.
- Steps to Reproduce:
### Stack Trace (if you have one)
An exception is thrown when we remove ProductiveByStrategy. However TinkerGraph can return correct result.
```
gremlin:>g.E().and(__.order().by('duration', asc))
==> result{object=e[1lb-394-36d-3cg][4216-knows->4336] class=org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge}
==> result{object=e[2se-3cg-3yt-6i8][4336-write->8432] class=org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge}
gremlin:> g.withoutStrategies(ProductiveByStrategy).E().and(__.order().by('duration', asc))
The provided traverser does not map to a value: e[1lb-394-36d-3cg][4216-knows->4336][CacheEdge]->value(duration)[ValueTraversal] parent[org.apache.tinkerpop.gremlin.process.traversal.util.EmptyTraversal@eb859eeb]
```
The graph data is as following:
```
Vertex bob = g.addV("person").property("name", "Bob").next();
Vertex alice = g.addV("person").property("name", "Alice").next();
Vertex book = g.addV("book").property("name", "book1").next();
Edge edge1 = g.addE("knows").from(bob).to(alice).next();
Edge edge2 = g.addE("write").from(alice).to(book).next();
g.E(edge2).property("duration", new Float(0.94461)).iterate();
```
Contributor guide
Research direction
Start by reproducing the Gremlin edge-sorting traversal with the in-memory storage backend, comparing the normal traversal with the version using withoutStrategies(ProductiveByStrategy). Trace the failure around order().by('duration', asc); done means both traversals return the same sorted edges without an exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100