presto-main/src/main/java/io/prestosql/operator/RowNumberOperator.java/RowNumberOperator/RowNumberOperator
class RowNumberOperator:    public RowNumberOperator(
            OperatorContext operatorContext,
            List<Type> sourceTypes,
            List<Integer> outputChannels,
            List<Integer> partitionChannels,
            List<Type> partitionTypes,
            Optional<Integer> maxRowsPerPartition,
            Optional<Integer> hashChannel,
            int expectedPositions,
            JoinCompiler joinCompiler)
    {
        this.operatorContext = requireNonNull(operatorContext, "operatorContext is null");
        this.localUserMemoryContext = operatorContext.localUserMemoryContext();
        this.outputChannels = Ints.toArray(outputChannels);
        this.types = toTypes(sourceTypes, outputChannels);

        this.maxRowsPerPartition = maxRowsPerPartition;
        if (maxRowsPerPartition.isPresent()) {
            selectedRowPageBuilder = Optional.of(new PageBuilder(types));
        }
        else {
            selectedRowPageBuilder = Optional.empty();
        }

        this.partitionRowCount = new LongBigArray(0);
        if (partitionChannels.isEmpty()) {
            this.groupByHash = Optional.empty();
        }
        else {
            int[] channels = Ints.toArray(partitionChannels);
            this.groupByHash = Optional.of(createGroupByHash(partitionTypes, channels, hashChannel, expectedPositions, isDictionaryAggregationEnabled(operatorContext.getSession()), joinCompiler, this::updateMemoryReservation));
        }
    }