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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]