apache / apache/hugegraph

Incorrect count() with sample()

Aperta
#1,981 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Java
Stelle
3.2k
Fork
636
Merge medio
3g 20h
PR unite (30g)
22

Descrizione

### 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: inmemory
- OS: xx CPUs, xx G RAM, Centos 7.x
- Data Size: xx vertices, xx edges

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

We create three vertices and expect the second query return value `2`, but it returns value `3`.

```
gremlin> :> hugegraph.traversal().V().sample(2)
==>[id:647369467348647938,label:product,type:vertex,properties:[name:product3]]
==>[id:647369467348647937,label:product,type:vertex,properties:[name:product2,price:4.5688]]
gremlin> :> hugegraph.traversal().V().sample(2).count()
==>3
```

The vertex example:
```
schema.propertyKey("name").asText().ifNotExist().create();
schema.propertyKey("price").asDouble().ifNotExist().create();
schema.vertexLabel("product").properties("name", "price").nullableKeys("name", "price").create();
schema.indexLabel("productbyname").onV("product").by("name").shard().ifNotExist().create();
schema.indexLabel("productbyprice").onV("product").by("price").shard().ifNotExist().create();

Vertex product1 = new Vertex("product").property("name", "product1").property("price", 3.254615);
Vertex product2 = new Vertex("product").property("name", "product2").property("price", 4.5688);
Vertex product3 = new Vertex("product").property("name", "product3");
```

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

_No response_

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

_No response_

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Reproduce the two Gremlin queries against the v0.12.0 inmemory backend: hugegraph.traversal().V().sample(2) and the same traversal followed by count(). Trace how sample(2) is handled before count(), using the three product vertices as the fixture. Done means the sampled traversal returns two vertices and count() returns 2.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
databases
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.