<div dir="ltr"><div>Looks like I partially misspoke here. Spark has a built-in approx_count_distinct function that uses the HyperLogLog algorithm under the hood and you should definitely prefer that over the spark-hyperloglog package if you need distinct counts in an analysis.</div><div><br></div><div>The advantage of spark-hyperloglog is that it allows us to create HLL data structures ahead of time and put them in long-term storage. So you will likely only need this package if you want to save HLL structures to an intermediate dataset.<br></div></div>