Package com.facebook.presto.operator.WindowOperator

Examples of com.facebook.presto.operator.WindowOperator.WindowOperatorFactory


        ConnectorSession session = new ConnectorSession("user", "source", "catalog", "schema", UTC_KEY, Locale.ENGLISH, "address", "agent");
        DriverContext driverContext = new TaskContext(new TaskId("query", "stage", "task"), executor, session, new DataSize(10, Unit.BYTE))
                .addPipelineContext(true, true)
                .addDriverContext();

        WindowOperatorFactory operatorFactory = new WindowOperatorFactory(
                0,
                ImmutableList.of(BIGINT, DOUBLE),
                Ints.asList(1),
                ROW_NUMBER,
                Ints.asList(),
                Ints.asList(0),
                ImmutableList.copyOf(new SortOrder[] {SortOrder.ASC_NULLS_LAST}),
                10);

        Operator operator = operatorFactory.createOperator(driverContext);

        toPages(operator, input);
    }
View Full Code Here


            for (Symbol symbol : windowFunctionOutputSymbols) {
                outputMappings.put(symbol, channel);
                channel++;
            }

            OperatorFactory operatorFactory = new WindowOperatorFactory(
                        context.getNextOperatorId(),
                        source.getTypes(),
                        outputChannels.build(),
                        windowFunctions,
                        partitionChannels,
View Full Code Here

            for (Symbol symbol : windowFunctionOutputSymbols) {
                outputMappings.put(symbol, new Input(channel));
                channel++;
            }

            OperatorFactory operatorFactory = new WindowOperatorFactory(
                    context.getNextOperatorId(),
                    source.getTupleInfos(),
                    outputChannels,
                    windowFunctions.build(),
                    partitionChannels,
View Full Code Here

                .pageBreak()
                .row(-1, -0.1)
                .row(5, 0.4)
                .build();

        WindowOperatorFactory operatorFactory = new WindowOperatorFactory(
                0,
                ImmutableList.of(SINGLE_LONG, SINGLE_DOUBLE),
                ints(1, 0),
                ROW_NUMBER,
                ints(),
                ints(0),
                sortOrder(SortOrder.ASC_NULLS_LAST),
                10);

        Operator operator = operatorFactory.createOperator(driverContext);

        MaterializedResult expected = resultBuilder(DOUBLE, FIXED_INT_64, FIXED_INT_64)
                .row(-0.1, -1, 1)
                .row(0.3, 2, 2)
                .row(0.2, 4, 3)
View Full Code Here

                .pageBreak()
                .row("b", 5, 0.4, false)
                .row("a", 6, 0.1, true)
                .build();

        WindowOperatorFactory operatorFactory = new WindowOperatorFactory(
                0,
                ImmutableList.of(SINGLE_VARBINARY, SINGLE_LONG, SINGLE_DOUBLE, SINGLE_BOOLEAN),
                ints(0, 1, 2, 3),
                ROW_NUMBER,
                ints(0),
                ints(1),
                sortOrder(SortOrder.ASC_NULLS_LAST),
                10);

        Operator operator = operatorFactory.createOperator(driverContext);

        MaterializedResult expected = resultBuilder(VARIABLE_BINARY, FIXED_INT_64, DOUBLE, BOOLEAN, FIXED_INT_64)
                .row("a", 2, 0.3, false, 1)
                .row("a", 4, 0.2, true, 2)
                .row("a", 6, 0.1, true, 3)
View Full Code Here

                .row(4)
                .row(6)
                .row(8)
                .build();

        WindowOperatorFactory operatorFactory = new WindowOperatorFactory(
                0,
                ImmutableList.of(SINGLE_LONG),
                ints(0),
                ROW_NUMBER,
                ints(),
                ints(),
                sortOrder(),
                10);
        Operator operator = operatorFactory.createOperator(driverContext);

        MaterializedResult expected = resultBuilder(FIXED_INT_64, FIXED_INT_64)
                .row(1, 1)
                .row(3, 2)
                .row(5, 3)
View Full Code Here

        Session session = new Session("user", "source", "catalog", "schema", "address", "agent");
        DriverContext driverContext = new TaskContext(new TaskId("query", "stage", "task"), executor, session, new DataSize(10, Unit.BYTE))
                .addPipelineContext(true, true)
                .addDriverContext();

        WindowOperatorFactory operatorFactory = new WindowOperatorFactory(
                0,
                ImmutableList.of(SINGLE_LONG, SINGLE_DOUBLE),
                ints(1),
                ROW_NUMBER,
                ints(),
                ints(0),
                sortOrder(SortOrder.ASC_NULLS_LAST),
                10);

        Operator operator = operatorFactory.createOperator(driverContext);

        toPages(operator, input);
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.operator.WindowOperator.WindowOperatorFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.