presto-main/src/main/java/io/prestosql/operator/aggregation/histogram/SingleTypedHistogram.java/SingleTypedHistogram/add
class SingleTypedHistogram:    @Override
    public void add(int position, Block block, long count)
    {
        int hashPosition = getBucketId(TypeUtils.hashPosition(type, block, position), mask);

        // look for an empty slot or a slot containing this key
        while (true) {
            if (hashPositions.get(hashPosition) == -1) {
                break;
            }

            if (type.equalTo(block, position, values, hashPositions.get(hashPosition))) {
                counts.add(hashPositions.get(hashPosition), count);
                return;
            }
            // increment position and mask to handle wrap around
            hashPosition = (hashPosition + 1) & mask;
        }

        addNewGroup(hashPosition, position, block, count);
    }