vaidikgarg-bit opened a new issue, #3443:
URL: https://github.com/apache/hugegraph/issues/3443

   In `BusinessHandlerImpl.scanIndex(graph, params, dedupOption, transElement, 
filterTTL)`, the `transElement` branch wraps `scanIndexToBaseElement` in 
`MapLimitIterator<BaseElement>` for `LIMIT_DEDUP`. `MapLimitIterator` dedups 
with a hash set of the elements themselves. `BaseEdge` defines 
`equals`/`hashCode` on `id()`, but `BaseVertex` and `BaseElement` define 
neither, so two vertex objects with the same id both get through. `DEDUP` and 
`PRECISE_DEDUP` on the same branch already hash on `id().asBytes()`.
   
   This can't be hit today. `BinaryElementSerializer.index2Element` throws 
`NotImplementedException`, and `StoreQueryParam` always sends 
`loadPropertyFromIndex=false`. It will show up once `index2Element` is 
implemented. Search indexes, secondary indexes on collection properties and 
joint secondary indexes all write several entries per element, and a scan that 
covers more than one of them returns the same vertex once per entry.
   
   Suggested fix: give `MapLimitIterator` a key extractor and pass 
`BaseElement::id` on this path. Adding `equals`/`hashCode` to `BaseVertex` in 
`hugegraph-struct` would also work, but it changes equality for every 
collection that holds vertices.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to