presto-orc/src/main/java/io/prestosql/orc/writer/DictionaryBuilder.java/DictionaryBuilder/addNewElement
class DictionaryBuilder:    private int addNewElement(long hashPosition, Block block, int position)
    {
        checkArgument(!block.isNull(position), "position is null");
        block.writeBytesTo(position, 0, block.getSliceLength(position), elementBlock);
        elementBlock.closeEntry();

        int newElementPositionInBlock = elementBlock.getPositionCount() - 1;
        blockPositionByHash.set(hashPosition, newElementPositionInBlock);

        // increase capacity, if necessary
        if (elementBlock.getPositionCount() >= maxFill) {
            rehash(maxFill * 2);
        }

        return newElementPositionInBlock;
    }