apache / apache/hugegraph

[Bug] Incorrect result triggered by "repeat(out()).times(x).count()" or "repeat(out()).times(x).dedup().count()"

Open
#2,142 9 comments 0 reactions 0 assignees View on GitHub
bug gremlin question
Dominant language
Java
Stars
3.2k
Forks
636
Avg merge
3d 11h
Merged PRs (30d)
14

Description

### Bug Type (问题类型)

gremlin (结果不合预期)

### Before submit

- [X] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 [FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)

### Environment (环境信息)

- Server Version: 1.0.0 (Apache Release Version)
- Backend: RocksDB x nodes, HDD or SSD
- OS: xx CPUs, xx G RAM, Ubuntu 2x.x / CentOS 7.x
- Data Size: 10 vertices, 27 edges

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

We want to repeat traversal from some vertices through the out-edges and counting.

```
gremlin> g.V().repeat(out()).times(50).dedup().count()
==> 0
gremlin> g.V().repeat(out()).times(50).count()
==> 0
```

The correct result of the two Gremlin queries could not be zero in the following graph:
![1677998575215](https://user-images.githubusercontent.com/37923722/222945910-06c4354d-0841-40d5-90dd-524308fa5db6.png)

I also test some other GDBs, for the first query, some other GDBs such as Arcade could return the correct result. For the second query, some other GDBs could return the correct result if there is no integer overflow occurrence.

Would it be possible to investigate it and fix it in a future release?
I think these queries may be used for some context that queries the count of the outward path with of large length from some source vertices.

### 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.