presto-main/src/main/java/io/prestosql/operator/PartitionedConsumption.java/PartitionedConsumption/computeNext
class PartitionedConsumption:    Iterator<Partition<T>> beginConsumption()
    {
        Queue<Partition<T>> partitions = new ArrayDeque<>(requireNonNull(this.partitions, "partitions is already null"));
        if (consumed.incrementAndGet() >= consumersCount) {
            // Unreference futures to allow GC
            this.partitions = null;
        }
        return new AbstractIterator<Partition<T>>()
        {
            @Override
            protected Partition<T> computeNext()
            {
                Partition<T> next = partitions.poll();
                if (next != null) {
                    return next;
                }
                else {
                    return endOfData();
                }
            }
        };
    }