presto-main/src/main/java/io/prestosql/operator/aggregation/histogram/HashUtil.java/HashUtil/calculateMaxFill
class HashUtil:    public static int calculateMaxFill(int bucketCount, float fillRatio)
    {
        checkArgument(bucketCount > 0, "bucketCount must be greater than 0");
        int maxFill = (int) Math.ceil(bucketCount * fillRatio);

        if (maxFill == bucketCount) {
            maxFill--;
        }
        checkArgument(bucketCount > maxFill, "bucketCount must be larger than maxFill");
        return maxFill;
    }