hisenyuan opened a new issue, #2979: URL: https://github.com/apache/datafusion-ballista/issues/2979
## Problem Ballista collects HyperLogLog distinct-count sketches while writing shuffle output. For non-null Int64 keys, the current path fills a reusable buffer with DataFusion hashes, then reads the buffer back to update the sketch. This adds buffer traffic to each batch. ## Proposed change Add a writer-only path that hashes 16 Int64 values at a time and feeds those hashes to the existing sketch update in row order. Keep both hash steps, the public `HyperLogLog::update` API, and the sketch format unchanged. Use the existing path for null-bearing arrays and other types. A one-time comparison against DataFusion's `create_hashes` should disable the fast path if the hashes differ, including when a downstream dependency enables forced hash collisions. ## Evidence and alternatives A local prototype measured 1.25% and 2.24% median paired reductions in sort-shuffle wall time on two 1M-row inputs with HLL enabled. Both runs used one task on an Apple M2 Max. These results are specific to small, repeatedly read inputs on one machine; they do not establish a distributed-query speedup. I also compared per-value fusion, block-wise `create_hashes`, and reusing the full buffer without clearing it. The 16-value loop was the most promising in the exploratory in-memory measurements. Serialized-byte comparisons against the existing path cover dense and nullable arrays, slices, batch boundaries, and writer statistics. [Reproduction instructions and raw samples](https://github.com/hisenyuan/datafusion-ballista/blob/ba4bbce197b7e4f405515234eca49adca9e73ac2/hll-int64-benchmark-evidence/readme.md) Related: apache/datasketches-rust#391. This proposal preserves both hash steps; it does not implement or resolve the upstream precomputed-hash API proposal. -- 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]
