JanusGraph / JanusGraph/janusgraph

Incorrectly comparing a value with multiple predicates

Open
#3,645 0 comments 0 reactions 0 assignees View on GitHub
kind/bug/possible
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

Please include configurations and logs if available.

For confirmed bugs, please report:

- Version: 0.6.3
- Storage Backend: inmemory
- Mixed Index Backend:
- Link to discussed bug:
- Expected Behavior:
- Current Behavior:
- Steps to Reproduce:

I compare a counted value with `inside(-1,1).and(lt(-1))`, and expect an empty result set. However, it returns two vertices.

```
gremlin> :> g.V().where(__.in('knows').count().is(inside(-1,1).and(lt(-1))))
==>v[8312]
==>v[4312]
```

The graph 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

Open the contributing guide

Research direction

Start by reproducing the Gremlin query in the issue against the shown in-memory graph and confirm that the combined predicates return vertices instead of an empty result. Trace the predicate comparison behavior used by count().is(), then verify that the corrected behavior returns no vertices for this example.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.