presto-spi/src/main/java/io/prestosql/spi/block/DictionaryBlock.java/DictionaryBlock/unnest
class DictionaryBlock:    private DictionaryBlock unnest()
    {
        if (!(dictionary instanceof DictionaryBlock)) {
            return this;
        }

        int[] ids = new int[positionCount];
        for (int i = 0; i < positionCount; i++) {
            ids[i] = getId(i);
        }

        Block dictionary = this.dictionary;
        while (dictionary instanceof DictionaryBlock) {
            DictionaryBlock nestedDictionary = (DictionaryBlock) dictionary;
            for (int i = 0; i < positionCount; i++) {
                ids[i] = nestedDictionary.getId(ids[i]);
            }
            dictionary = nestedDictionary.getDictionary();
        }

        return new DictionaryBlock(dictionary, ids);
    }