[Bug] Wrong result for where(count().is(lt(0))) when counted traversal is empty
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start by reproducing the minimal graph and query g.V('a').where(__.both('R').count().is(lt(0))).values('i') against the stated HugeGraph 1.7.0 environment. Trace the where() child traversal behavior for an empty both('R') result and add coverage for this case; done means the query returns [] rather than `[1]].
Written by the indexing model from the issue text.
Description
Bug Type (问题类型)
gremlin (结果不合预期)
Before submit
- 我已经确认现有的 Issues 与 FAQ 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)
Environment (环境信息)
- Server Version: 1.7.0
- gremlin: 3.5.1
- Docker Image:
hugegraph/hugegraph:latest - Backend: default Docker standalone backend
- Data Size: 1 vertex, 0 edges
Expected & Actual behavior (期望与实际表现)
HugeGraph keeps a traverser for a where() child traversal whose count() is 0 and whose predicate is lt(0).
Minimal graph:
(a:A {i: 1})
No R edges exist.
Bug-triggering query:
g.V('a').where(__.both('R').count().is(lt(0))).values('i')
Expected:
[]
Actual:
[1]
Since the counted traversal returns 0, the predicate lt(0) should be false.
Vertex/Edge example (问题点 / 边数据举例)
**Vertex/Edge example**
curl -fsS --compressed -X DELETE \
"http://127.0.0.1:8080/graphs/hugegraph/clear?confirm_message=I'm%20sure%20to%20delete%20all%20data"
curl -fsS --compressed -H 'Content-Type: application/json' -X POST \
-d '{"id":"a","label":"A","properties":{"i":1}}' \
"http://127.0.0.1:8080/graphs/hugegraph/graph/vertices"
Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
**Schema**
curl -fsS --compressed -H 'Content-Type: application/json' -X POST \
-d '{"name":"i","data_type":"LONG","cardinality":"SINGLE"}' \
"http://127.0.0.1:8080/graphs/hugegraph/schema/propertykeys"
curl -fsS --compressed -H 'Content-Type: application/json' -X POST \
-d '{"name":"A","id_strategy":"CUSTOMIZE_STRING","properties":["i"],"nullable_keys":["i"],"enable_label_index":true}' \
"http://127.0.0.1:8080/graphs/hugegraph/schema/vertexlabels"
curl -fsS --compressed -H 'Content-Type: application/json' -X POST \
-d '{"name":"B","id_strategy":"CUSTOMIZE_STRING","properties":[],"nullable_keys":[],"enable_label_index":true}' \
"http://127.0.0.1:8080/graphs/hugegraph/schema/vertexlabels"
curl -fsS --compressed -H 'Content-Type: application/json' -X POST \
-d '{"name":"R","source_label":"B","target_label":"A","frequency":"SINGLE","properties":[],"nullable_keys":[],"enable_label_index":true}' \
"http://127.0.0.1:8080/graphs/hugegraph/schema/edgelabels"
- Dominant language
- Java
- Stars
- 3.2k
- Forks
- 637
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 23
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/hugegraph
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 28/100
All issues in apache/hugegraph
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100