presto-main/src/main/java/io/prestosql/operator/aggregation/histogram/GroupedTypedHistogram.java/BucketDataNode/addNewGroup
class BucketDataNode:        private void addNewGroup(long groupId, Block block, int position, long count)
        {
            checkState(isEmpty(), "bucket %s not empty, points to %s", bucketId, buckets.get(bucketId));

            // we've already computed the value hash for only the value only; ValueStore will save it for future use
            int nextValuePosition = valueStore.addAndGetPosition(type, block, position, valueHash);
            // set value pointer to hash map of values
            valuePositions.set(nodePointerToUse, nextValuePosition);
            // save hashes for future rehashing
            valueAndGroupHashes.set(nodePointerToUse, valueAndGroupHash);
            // set pointer to node for this bucket
            buckets.set(bucketId, nodePointerToUse);
            // save data for this node
            counts.set(nodePointerToUse, count);
            // used for doing value comparisons on hash collisions
            groupIds.set(nodePointerToUse, groupId);
            // we only ever store ints as values; we need long as an index
            int currentHead = (int) headPointers.get(groupId);
            // maintain linked list of nodes in this group (insert at head)
            headPointers.set(groupId, nodePointerToUse);
            nextPointers.set(nodePointerToUse, currentHead);
        }