You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by GitBox <gi...@apache.org> on 2020/05/29 13:08:16 UTC
[GitHub] [incubator-datasketches-hive] Lordshinjo commented on pull request #51: Fix theta sketch estimation if input has extra bytes
Lordshinjo commented on pull request #51:
URL: https://github.com/apache/incubator-datasketches-hive/pull/51#issuecomment-635962724
(Disclaimer: not a contributor here)
It looks to me like that same mistake is done in pretty much every UDF here.
It might be worth it to create a static method converting a `BytesWritable` to a `Memory`, since `Memory` is the base for all sketches.
It could look something like this, to avoid having to copy lots of byte arrays:
```java
Memory bytesWritableToMemory(final BytesWritable bw) {
return Memory.wrap(bw.getBytes(), 0, bw.getLength(), ByteOrder.nativeOrder());
}
```
Then any length check could be done on the `BytesWritable`'s `getLength()` directly.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org