QasimKhan5d opened a new pull request, #43:
URL: https://github.com/apache/datasketches-go/pull/43
Go code was producing seed hash inconsistent with java seed hash, which led
to this error during cross serde test in java:
`org.apache.datasketches.common.SketchesArgumentException: Incompatible Seed
Hashes. 93cc, d58a: Incompatible Seed Hashes. 93cc, d58a`
In the Java code we do:
```java
// Java: hash the one‐element array [seed] with algorithm‐seed = 0
long[] seedArr = { seed };
short seedHash = (short)(MurmurHash3.hash(seedArr, 0L)[0] & 0xFFFFL);
```
but in the Go code:
```go
// Go: hashing [seed] with algorithm‐seed = seed
seedArr := []int64{seed}
seedHash64, _ := HashInt64SliceMurmur3(seedArr, 0, 1, uint64(seed))
seedHash := uint16(seedHash64 & 0xFFFF)
```
That one‐bit difference in the *algorithm seed* turns a 0x93cc into a 0xd58a
(for seed=9001).
### Fix
Make the Go call use **0** as the Murmur3 seed, not `uint64(seed)`.
With this change, both implementations will produce the same seed hash,
which restores compatibility.
--
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]