JanusGraph / JanusGraph/janusgraph
Inconsistent handling of sorting vertices or edges with property
- Dominant language
- Java
- Stars
- 5.8k
- Forks
- 1.2k
- Avg merge
- 13h 53m
- Merged PRs (30d)
- 6
Description
- Version: 0.6.2
- Storage Backend: inmemory
- Mixed Index Backend: lucene
- Link to discussed bug:
- Steps to Reproduce:
### Stack Trace (if you have one)
```
Vertex v1 = g.addV("vl0").property("vp0", "Bob").next(); // id: 4201
Vertex v2 = g.addV("vl0").property("vp1", "Alice").next(); // id: 4200
Edge e1 = g.addE("el0").from(v1).to(v2).next();
```
We create two vertices and one edge.
When we execute the query `g.V().order().by('vp0').not(outE('el0')).count();`, we can get a result `1`. However, we noted that JanusGraph should throw an exception `The property does not exist as the key has no associated value for the provided element: v[4200]:vp0` because vertex `v2` has not a property `vp0`.
Actually, we can trigger this exception correctly by executing `g.V().order().by('vp0').outE('el0').count()`.
I'm curious why JanusGraph behaves inconsistently. Maybe there is a minor issue in optimization layer?
Contributor guide
Research direction
The report names no source file or test; start by reproducing the two Gremlin queries using the supplied in-memory and mixed Lucene backend setup. Trace the optimization layer involved in ordering by a missing property and compare both query paths. Done means the handling is consistent and matches the reported missing-property behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100