presto-main/src/main/java/io/prestosql/operator/aggregation/histogram/GroupedTypedHistogram.java/GroupedTypedHistogram/GroupedTypedHistogram
class GroupedTypedHistogram:    public GroupedTypedHistogram(Type type, int expectedCount)
    {
        checkArgument(expectedCount > 0, "expectedSize must be greater than zero");
        this.type = type;
        this.bucketId = expectedCount;
        this.bucketCount = computeBucketCount(expectedCount, MAX_FILL_RATIO);
        this.mask = bucketCount - 1;
        this.maxFill = calculateMaxFill(bucketCount, MAX_FILL_RATIO);
        this.values = type.createBlockBuilder(null, computeBucketCount(expectedCount, GroupedTypedHistogram.MAX_FILL_RATIO));
        // buckets and node-arrays (bucket "points" to a node, so 1:1 relationship)
        buckets = new IntBigArray(-1);
        buckets.ensureCapacity(bucketCount);
        counts = new LongBigArray();
        valuePositions = new IntBigArray();
        valueAndGroupHashes = new LongBigArray();
        nextPointers = new IntBigArray(NULL);
        groupIds = new LongBigArray(-1);
        // here, one bucket is one node in the hash structure (vs a bucket may be a chain of nodes in closed-hashing with linked list hashing)
        // ie, this is open-address hashing
        resizeNodeArrays(bucketCount);
        // end bucket/node based arrays
        // per-group arrays: size will be set by external call, same as groups since the number will be the same
        headPointers = new LongBigArray(NULL);
        // index into counts/valuePositions
        nextNodePointer = 0;
        bucketNodeFactory = this.new BucketNodeFactory();
        valueStore = new ValueStore(expectedCount, values);
    }