Skip to content

Commit c6ed433

Browse files
Bugfix: HLL4 written in rust cannot not be loaded in Java (#132)
1 parent 779a467 commit c6ed433

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

datasketches/src/hll/array4.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use crate::common::NumStdDev;
2929
use crate::error::Error;
3030
use crate::hll::Coupon;
3131
use crate::hll::estimator::HipEstimator;
32+
use crate::hll::serialization::COMPACT_FLAG_MASK;
3233
use crate::hll::serialization::COUPON_SIZE_BYTES;
3334
use crate::hll::serialization::CUR_MODE_HLL;
3435
use crate::hll::serialization::HLL_PREAMBLE_SIZE;
@@ -388,8 +389,10 @@ impl Array4 {
388389
bytes.write_u8(lg_config_k);
389390
bytes.write_u8(0); // unused for HLL mode
390391

391-
// Write flags
392-
let mut flags = 0u8;
392+
// Write flags.
393+
// COMPACT_FLAG_MASK is always set: aux map entries are written as a compact sequential
394+
// list of populated entries only.
395+
let mut flags = COMPACT_FLAG_MASK;
393396
if self.estimator.is_out_of_order() {
394397
flags |= OUT_OF_ORDER_FLAG_MASK;
395398
}

0 commit comments

Comments
 (0)