leerho opened a new pull request, #789:
URL: https://github.com/apache/datasketches-java/pull/789

   An empty compact ArrayOfDoubles (AoD) image now carries a zero seed hash, 
and readers ignore those bytes on an empty image. This aligns AoD with Java 
Theta, with the generic tuple sketch (#772), and with C++ (datasketches-cpp 
c11a5ea), which already writes a zero seed hash for an empty compact tuple 
sketch.
   
   ## Changes
   
   - **Write:** `HeapArrayOfDoublesCompactSketch` and 
`DirectArrayOfDoublesCompactSketch` write a zero seed hash when the sketch is 
empty.
   - **Read:** heapify and wrap check the seed hash only for a non-empty image, 
so historical empty images that filled the field in still load.
   - **Set operations:** `ArrayOfDoublesUnion`, `ArrayOfDoublesIntersection` 
and `ArrayOfDoublesAnotBImpl` skip the seed-hash check for an empty input, as 
the Theta set operations do. A-not-B takes its seed hash from whichever input 
is non-empty.
   
   ## Why
   
   Java rejected every empty AoD image written by C++ (and so by Python) with 
`Incompatible Seed Hashes. 0, 93cc`. `AodSketchCrossLanguageTest.checkCpp` has 
been a known failure because of this; it passes with this change.
   
   ## Compatibility
   
   Release 9.0.0 and earlier check the seed hash of an empty AoD image, so they 
reject an empty compact AoD image written by this version, just as they reject 
the C++ ones today. Non-empty AoD images are unchanged. This will be called out 
in the 9.1.0 release notes.
   
   ## Testing
   
   - New tests in `HeapArrayOfDoublesCompactSketchTest` cover the zero seed 
hash on write, ignoring it on read, and reading a historical empty image with a 
filled-in seed hash. The union, intersection and A-not-B tests cover empty 
inputs.
   - `mvn verify`: 2321 tests, 0 failures.
   - `AodSketchCrossLanguageTest.checkCpp` against the current C++ files: fails 
on main, passes with this change.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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