Examples of TopNOperatorFactory


Examples of com.facebook.presto.operator.TopNOperator.TopNOperatorFactory

                .row(4, 0.41)
                .row(6, 0.6)
                .pageBreak()
                .build();

        TopNOperatorFactory factory = new TopNOperatorFactory(
                0,
                ImmutableList.of(BIGINT, DOUBLE),
                2,
                ImmutableList.of(0),
                ImmutableList.of(DESC_NULLS_LAST),
                false);

        Operator operator = factory.createOperator(driverContext);

        MaterializedResult expected = resultBuilder(driverContext.getSession(), BIGINT, DOUBLE)
                .row(6, 0.6)
                .row(5, 0.5)
                .build();
View Full Code Here

Examples of com.facebook.presto.operator.TopNOperator.TopNOperatorFactory

                .row("d", 5)
                .row("d", 7)
                .row("e", 6)
                .build();

        TopNOperatorFactory operatorFactory = new TopNOperatorFactory(
                0,
                ImmutableList.of(VARCHAR, BIGINT),
                3,
                ImmutableList.of(0, 1),
                ImmutableList.of(DESC_NULLS_LAST, DESC_NULLS_LAST),
                false);

        Operator operator = operatorFactory.createOperator(driverContext);

        MaterializedResult expected = MaterializedResult.resultBuilder(driverContext.getSession(), VARCHAR, BIGINT)
                .row("f", 3)
                .row("e", 6)
                .row("d", 7)
View Full Code Here

Examples of com.facebook.presto.operator.TopNOperator.TopNOperatorFactory

                .row(4, 0.41)
                .row(6, 0.6)
                .pageBreak()
                .build();

        TopNOperatorFactory operatorFactory = new TopNOperatorFactory(
                0,
                ImmutableList.of(BIGINT, DOUBLE),
                2,
                ImmutableList.of(0),
                ImmutableList.of(ASC_NULLS_LAST),
                false);

        Operator operator = operatorFactory.createOperator(driverContext);

        MaterializedResult expected = resultBuilder(driverContext.getSession(), BIGINT, DOUBLE)
                .row(-1, -0.1)
                .row(1, 0.1)
                .build();
View Full Code Here

Examples of com.facebook.presto.operator.TopNOperator.TopNOperatorFactory

                sortOrders.add(node.getOrderings().get(symbol));
            }

            Optional<Integer> sampleWeightChannel = node.getSampleWeight().transform(source.channelGetter());

            OperatorFactory operator = new TopNOperatorFactory(
                    context.getNextOperatorId(),
                    source.getTypes(),
                    (int) node.getCount(),
                    sortChannels,
                    sortOrders,
View Full Code Here

Examples of com.facebook.presto.operator.TopNOperator.TopNOperatorFactory

            Ordering<TupleReadable> ordering = Ordering.from(new FieldOrderedTupleComparator(sortFields, sortOrders));

            IdentityProjectionInfo mappings = computeIdentityMapping(node.getOutputSymbols(), source.getLayout(), context.getTypes());

            OperatorFactory operator = new TopNOperatorFactory(
                    context.getNextOperatorId(),
                    (int) node.getCount(),
                    orderByChannel,
                    mappings.getProjections(),
                    ordering,
View Full Code Here

Examples of com.facebook.presto.operator.TopNOperator.TopNOperatorFactory

            Ordering<TupleReadable[]> ordering = Ordering.from(new FieldOrderedTupleComparator(sortChannels, sortOrders));

            IdentityProjectionInfo mappings = computeIdentityMapping(node.getOutputSymbols(), source.getLayout(), context.getTypes());

            OperatorFactory operator = new TopNOperatorFactory(
                    context.getNextOperatorId(),
                    (int) node.getCount(),
                    mappings.getProjections(),
                    ordering,
                    node.isPartial());
View Full Code Here

Examples of com.facebook.presto.operator.TopNOperator.TopNOperatorFactory

            IdentityProjectionInfo mappings = computeIdentityMapping(node.getOutputSymbols(), source.getLayout(), context.getTypes());

            Optional<Integer> sampleWeightChannel = node.getSampleWeight().transform(source.channelGetter());

            OperatorFactory operator = new TopNOperatorFactory(
                    context.getNextOperatorId(),
                    (int) node.getCount(),
                    mappings.getProjections(),
                    ordering,
                    sampleWeightChannel,
View Full Code Here

Examples of com.facebook.presto.operator.TopNOperator.TopNOperatorFactory

    @Override
    protected List<? extends OperatorFactory> createOperatorFactories()
    {
        OperatorFactory tableScanOperator = createTableScanOperator(0, "orders", "totalprice");
        TopNOperatorFactory topNOperator = new TopNOperatorFactory(
                1,
                tableScanOperator.getTypes(),
                100,
                ImmutableList.of(0),
                ImmutableList.of(ASC_NULLS_LAST),
View Full Code Here

Examples of com.facebook.presto.operator.TopNOperator.TopNOperatorFactory

                sortOrders.add(node.getOrderings().get(symbol));
            }

            Optional<Integer> sampleWeightChannel = node.getSampleWeight().transform(source.channelGetter());

            OperatorFactory operator = new TopNOperatorFactory(
                    context.getNextOperatorId(),
                    source.getTypes(),
                    (int) node.getCount(),
                    sortChannels,
                    sortOrders,
View Full Code Here

Examples of com.facebook.presto.operator.TopNOperator.TopNOperatorFactory

    @Override
    protected List<? extends OperatorFactory> createOperatorFactories()
    {
        OperatorFactory tableScanOperator = createTableScanOperator(0, "orders", "totalprice");
        TopNOperatorFactory topNOperator = new TopNOperatorFactory(
                1,
                tableScanOperator.getTypes(),
                100,
                ImmutableList.of(0),
                ImmutableList.of(ASC_NULLS_LAST),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.