leerho commented on issue #807:
URL: 
https://github.com/apache/datasketches-java/issues/807#issuecomment-7018301764

   When we did the original work on sketches back in 2012-2014, few engineers 
had even heard of sketches, so we felt it was important to try to protect 
sketch users from themselves. Thus, the fixed hash function, default hash seed, 
the short seed hash, etc. 
   
   Now, sketching is more widespread, and I think we can open up more access 
into the fundamental hashing operations of these sketches.  
   
   Your idea makes sense, but I think the implementation will need to be 
thought out carefully.
   
   - We don't want any code duplication.  If we set up a "HashUtility" 
somewhere it should also be leveraged by the update(*) methods currently in the 
sketches that use hashing: Theta, Tuple, CPC, etc.  This would minimize API 
disruption for users that don't have your use case.
   - There is other "hash conditioning" that goes on in the update(*) functions 
other than the (h >>> 1) operation: floating-point, strings, and arrays all 
have special canonicalization operations and checks.  It would be nice if all 
of this special handling could also be centralized into this "HashUtility".  
This will make it trivial to add additional update types that the current 
sketches don't handle, e.g., 'update(MemorySegment), update(short[]), etc.".  
   - The fact that some sketches use 128 bits and others only use 64 bits is a 
wrinkle we will have to think through.
   - The result, I think, would mean a rewrite of the whole "update(item, 
seed?)" section of a number of sketches.  
   - If you are willing to propose an initial design for this, we can discuss 
it here.


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