presto-main/src/main/java/io/prestosql/operator/unnest/UnnestOperator.java/UnnestOperator/processCurrentPosition
class UnnestOperator:    private int processCurrentPosition()
    {
        // Determine number of output rows for this input position
        int maxEntries = getCurrentMaxEntries();

        // For 'outer' type, in case unnesters produce no output,
        // append a single row replicating values of replicate channels
        // and appending nulls for unnested chennels
        if (outer && maxEntries == 0) {
            replicatedBlockBuilders.forEach(blockBuilder -> blockBuilder.appendRepeated(currentPosition, 1));
            unnesters.forEach(unnester -> {
                unnester.appendNulls(1);
                unnester.advance();
            });
            if (withOrdinality) {
                ordinalityBlockBuilder.appendNull();
            }
            return 1;
        }

        // Append elements repeatedly to replicate output columns
        replicatedBlockBuilders.forEach(blockBuilder -> blockBuilder.appendRepeated(currentPosition, maxEntries));

        // Process this position in unnesters
        unnesters.forEach(unnester -> unnester.processCurrentAndAdvance(maxEntries));

        if (withOrdinality) {
            for (long ordinalityCount = 1; ordinalityCount <= maxEntries; ordinalityCount++) {
                BIGINT.writeLong(ordinalityBlockBuilder, ordinalityCount);
            }
        }

        return maxEntries;
    }