Skip to content

Commit

Permalink
address code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
deemoliu committed Sep 20, 2023
1 parent 32ada40 commit 51b5cae
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,6 @@ public HyperLogLogPlus deserialize(byte[] bytes) {

@Override
public HyperLogLogPlus deserialize(ByteBuffer byteBuffer) {
// NOTE: The passed in byte buffer is always BIG ENDIAN
byte[] bytes = new byte[byteBuffer.remaining()];
byteBuffer.get(bytes);
return deserialize(bytes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ private static HyperLogLog getDistinctCountHLLResult(Dictionary dictionary,
private static HyperLogLogPlus getDistinctCountHLLPlusResult(Dictionary dictionary,
DistinctCountHLLPlusAggregationFunction function) {
if (dictionary.getValueType() == FieldSpec.DataType.BYTES) {
// Treat BYTES value as serialized HyperLogLog
// Treat BYTES value as serialized HyperLogLogPlus
try {
HyperLogLogPlus hllplus = ObjectSerDeUtils.HYPER_LOG_LOG_PLUS_SER_DE.deserialize(dictionary.getBytesValue(0));
int length = dictionary.length();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,7 @@ public HyperLogLogPlus deserialize(byte[] bytes) {
public HyperLogLogPlus deserialize(ByteBuffer byteBuffer) {
byte[] bytes = new byte[byteBuffer.remaining()];
byteBuffer.get(bytes);
try {
return HyperLogLogPlus.Builder.build(bytes);
} catch (IOException e) {
throw new RuntimeException("Caught exception while de-serializing HyperLogLogPlus", e);
}
return deserialize(bytes);
}
};

Expand Down

0 comments on commit 51b5cae

Please sign in to comment.