Fengzdadi opened a new issue, #103:
URL: https://github.com/apache/datasketches-go/issues/103

   I am very sorry, but I realized this problem while reviewing the algorithm 
these past two days. The current `ReservoirItemsUnion` implementation is 
missing some features compared to the Java reference implementation, and there 
are also some algorithmic simplification issues. Even though it passed the 
tests at the time, the tests seem to be incomplete.
   
   I want to keep this issue open until I am certain that the 
`ReservoirItemsUnion` functionality is correctly implemented.
   
   Again, I apologize for the inconvenience.
   
   ## Remaining Work
   
   ### Serialization
   - [ ] 
[ToSlice(serde)](cci:1://file:///d:/Code/Projects/apache/datasketches-go/sampling/reservoir_items_sketch.go:194:0-224:1)
 → Java: 
[`toByteArray(ArrayOfItemsSerDe)`](https://github.com/apache/datasketches-java/blob/master/src/main/java/org/apache/datasketches/sampling/ReservoirItemsUnion.java#L249)
   - [ ] `NewReservoirItemsUnionFromSlice(data, serde)` → Java: 
[`heapify(MemorySegment, 
ArrayOfItemsSerDe)`](https://github.com/apache/datasketches-java/blob/master/src/main/java/org/apache/datasketches/sampling/ReservoirItemsUnion.java#L95)
   
   ### Update from bytes  
   - [ ] `UpdateFromSlice(data, serde)` → Java: [`update(MemorySegment, 
ArrayOfItemsSerDe)`](https://github.com/apache/datasketches-java/blob/master/src/main/java/org/apache/datasketches/sampling/ReservoirItemsUnion.java#L117)
   
   ### Utility
   - [ ] 
[String()](cci:2://file:///d:/Code/Projects/apache/datasketches-go/sampling/serde.go:121:0-121:25)
 → Java: 
[`toString()`](https://github.com/apache/datasketches-java/blob/master/src/main/java/org/apache/datasketches/sampling/ReservoirItemsUnion.java#L263)
   
   ## Already Fixed
   
   - [x] Core merge logic → Java: 
[twoWayMergeInternal](https://github.com/apache/datasketches-java/blob/master/src/main/java/org/apache/datasketches/sampling/ReservoirItemsUnion.java#L365)
   - [x] Weighted sampling → Java: 
[twoWayMergeInternalWeighted](https://github.com/apache/datasketches-java/blob/master/src/main/java/org/apache/datasketches/sampling/ReservoirItemsUnion.java#L399)
   - [x] Gadget initialization → Java: 
[createNewGadget](https://github.com/apache/datasketches-java/blob/master/src/main/java/org/apache/datasketches/sampling/ReservoirItemsUnion.java#L324)
   - [x] Downsampling → Java: 
[`downsampledCopy`](https://github.com/apache/datasketches-java/blob/master/src/main/java/org/apache/datasketches/sampling/ReservoirItemsSketch.java#L622)


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to