Class HyperLogLogPlusPlus
java.lang.Object
org.apache.flink.table.runtime.functions.aggregate.hyperloglog.HyperLogLogPlusPlus
The implement of HyperLogLogPlusPlus is inspired from Apache Spark.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleestimateBias(double e) Estimate the bias using the raw estimates with their respective biases from the HLL++ appendix.intvoidMerge the HLL buffers by iterating through the registers in both buffers and select the maximum number of leading zeros for each register.longCompute the HyperLogLog estimate.doubletrueRsd()Thersdof HLL++ is always equal to or better than thersdrequested.voidupdateByHashcode(HllBuffer buffer, long hash) Update the HLL++ buffer.
-
Constructor Details
-
HyperLogLogPlusPlus
public HyperLogLogPlusPlus(double relativeSD)
-
-
Method Details
-
getNumWords
public int getNumWords() -
updateByHashcode
Update the HLL++ buffer. -
merge
Merge the HLL buffers by iterating through the registers in both buffers and select the maximum number of leading zeros for each register. -
estimateBias
public double estimateBias(double e) Estimate the bias using the raw estimates with their respective biases from the HLL++ appendix. We currently use KNN interpolation to determine the bias (as suggested in the paper). -
query
Compute the HyperLogLog estimate.Variable names in the HLL++ paper match variable names in the code.
-
trueRsd
public double trueRsd()Thersdof HLL++ is always equal to or better than thersdrequested. This method returns thersdthis instance actually guarantees.- Returns:
- the actual
rsd.
-