apache / apache/hugegraph

[Bug] Incorrect results when querying vertices by filtering properties using not(eq()) API

Open
#1,966 5 comments 0 reactions 0 assignees View on GitHub
bug improvement
Dominant language
Java
Stars
3.2k
Forks
636
Avg merge
3d 11h
Merged PRs (30d)
14

Description

### Bug Type (问题类型)

_No response_

### Before submit

- [X] 我已经确认现有的 [Issues](https://github.com/hugegraph/hugegraph/issues) 与 [FAQ](https://hugegraph.github.io/hugegraph-doc/guides/faq.html) 中没有相同 / 重复问题

### Environment (环境信息)

- Server Version: v0.12.0
- Backend: memory
- OS: linux
- As below

### Expected & Actual behavior (期望与实际表现)

```
schema.propertyKey("vp0").asInt().ifNotExist().create();
schema.vertexLabel("vl0").properties("vp0").nullableKeys("vp0").create();
schema.indexLabel("index").onV("vl0").by("vp0").shard().ifNotExist().create();

Vertex v0 = new Vertex("vl0").property("vp0", 1); // id: 636889487204417536
Vertex v1 = new Vertex("vl0").property("vp0", 2); // id: 636889487204417537
```

We create two vertices with property `vp0`. We want to execute the query `g.V().has('vp0', not(eq(1)))` to obtain the vertex `v1`. However, an exception `Don't accept query based on properties [vp0] that are not indexed in any label, may not match not-equal condition` was thrown.

What's interesting is that when we execute the query with vertex ids, i.e., `g.V(636889487204417536, 636889487204417537).has('vp0', not(eq(1)))`, we can retrieve the vertex `v1`. Actually, we can also get correct result with API `eq()`. Maybe there is something wrong when processing API `not(eq())`?

### Vertex/Edge example (问题点 / 边数据举例)

_No response_

### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.