presto-main/src/main/java/io/prestosql/operator/TopNOperator.java/TopNOperator/TopNOperator
class TopNOperator:    public TopNOperator(
            MemoryTrackingContext memoryTrackingContext,
            Optional<WorkProcessor<Page>> sourcePages,
            List<Type> types,
            int n,
            List<Integer> sortChannels,
            List<SortOrder> sortOrders)
    {
        this.topNProcessor = new TopNProcessor(
                requireNonNull(memoryTrackingContext, "memoryTrackingContext is null").aggregateUserMemoryContext(),
                types,
                n,
                sortChannels,
                sortOrders);

        if (n == 0) {
            pages = WorkProcessor.of();
        }
        else {
            pages = sourcePages.orElse(pageBuffer.pages()).transform(new TopNPages());
        }
    }