tisonkun opened a new issue, #318: URL: https://github.com/apache/datasketches-rust/issues/318
## Problem PR #317 adds `HllUnion::serialize()`, which directly emits an HLL8 result. The union accepts HLL4, HLL6, and HLL8 inputs, but callers choosing HLL4 or HLL6 output still need `union.to_sketch(hll_type).serialize()`, allocating an intermediate sketch. Applications persisting or transferring results should be able to choose the register representation when serializing directly. ## Suggested approach - Define an output-type selection API consistent with `HllUnion::to_sketch(HllType)`; document the output representation and effective precision. - Share encoding logic with sketch serialization. Keep the HLL8 fast path and implement HLL4/HLL6 output without constructing a complete temporary sketch merely to serialize it. - Account for the packing and auxiliary-entry work required by HLL4/HLL6; direct serialization need not eliminate all scratch storage. Start with `datasketches/src/hll/union.rs`, `array4.rs`, `array6.rs`, and `array8.rs`. This is a follow-up to #317; its current no-argument method is the starting point for the API discussion. ## Validation Compare each output type against `to_sketch(type).serialize()` for empty, LIST, SET, and dense results, including downsampling, merged estimator state, and HLL4 auxiliary entries. Verify round trips and existing cross-language fixtures. Extend `benchmarks/hll/serde.rs` to measure time and allocations for all three output types. Follow CONTRIBUTING.md for changelog entries, integration-test placement, serialization fixtures, and the required checks. -- 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]
