Examples of FieldOrderedTupleComparator


Examples of com.facebook.presto.tuple.FieldOrderedTupleComparator

        TopNOperatorFactory operatorFactory = new TopNOperatorFactory(
                0,
                2,
                ImmutableList.of(singleColumn(FIXED_INT_64, 0), singleColumn(DOUBLE, 1)),
                Ordering.from(new FieldOrderedTupleComparator(ImmutableList.of(0), ImmutableList.of(SortOrder.ASC_NULLS_LAST))),
                false);

        Operator operator = operatorFactory.createOperator(driverContext);

        MaterializedResult expected = resultBuilder(FIXED_INT_64, DOUBLE)
View Full Code Here

Examples of com.facebook.presto.tuple.FieldOrderedTupleComparator

        AlignmentOperatorFactory alignmentOperator = new AlignmentOperatorFactory(0, blockIterable);
        TopNOperatorFactory topNOperator = new TopNOperatorFactory(
                1,
                100,
                ImmutableList.of(singleColumn(Type.DOUBLE, 0)),
                Ordering.from(new FieldOrderedTupleComparator(ImmutableList.of(0), ImmutableList.of(SortOrder.DESC_NULLS_LAST))),
                false);
        return ImmutableList.of(alignmentOperator, topNOperator);
    }
View Full Code Here

Examples of com.facebook.presto.tuple.FieldOrderedTupleComparator

            for (Symbol symbol : orderBySymbols) {
                sortChannels.add(source.getLayout().get(symbol).getChannel());
                sortOrders.add(node.getOrderings().get(symbol));
            }

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

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

            Optional<Integer> sampleWeightChannel = node.getSampleWeight().transform(source.channelGetter());
View Full Code Here

Examples of com.facebook.presto.tuple.FieldOrderedTupleComparator

            for (Symbol symbol : orderBySymbols) {
                sortFields.add(getFirst(source.getLayout().get(symbol)).getField());
                sortOrders.add(node.getOrderings().get(symbol));
            }

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

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

            OperatorFactory operator = new TopNOperatorFactory(
                    context.getNextOperatorId(),
View Full Code Here

Examples of com.facebook.presto.tuple.FieldOrderedTupleComparator

        TopNOperatorFactory factory = new TopNOperatorFactory(
                0,
                5,
                ImmutableList.of(singleColumn(FIXED_INT_64, 0), singleColumn(DOUBLE, 1), singleColumn(FIXED_INT_64, 2)),
                Ordering.from(new FieldOrderedTupleComparator(ImmutableList.of(0), ImmutableList.of(SortOrder.DESC_NULLS_LAST))),
                Optional.of(input.get(0).getChannelCount() - 1),
                false);

        Operator operator = factory.createOperator(driverContext);
View Full Code Here

Examples of com.facebook.presto.tuple.FieldOrderedTupleComparator

        TopNOperatorFactory factory = new TopNOperatorFactory(
                0,
                2,
                ImmutableList.of(singleColumn(FIXED_INT_64, 0), singleColumn(DOUBLE, 1)),
                Ordering.from(new FieldOrderedTupleComparator(ImmutableList.of(0), ImmutableList.of(SortOrder.DESC_NULLS_LAST))),
                Optional.<Integer>absent(),
                false);

        Operator operator = factory.createOperator(driverContext);
View Full Code Here

Examples of com.facebook.presto.tuple.FieldOrderedTupleComparator

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

        FieldOrderedTupleComparator comparator = new FieldOrderedTupleComparator(ImmutableList.of(0, 1), ImmutableList.of(SortOrder.DESC_NULLS_LAST, SortOrder.DESC_NULLS_LAST));
        TopNOperatorFactory operatorFactory = new TopNOperatorFactory(
                0,
                3,
                ImmutableList.of(singleColumn(VARIABLE_BINARY, 0), singleColumn(FIXED_INT_64, 1)),
                Ordering.from(comparator),
View Full Code Here

Examples of com.facebook.presto.tuple.FieldOrderedTupleComparator

        TopNOperatorFactory operatorFactory = new TopNOperatorFactory(
                0,
                2,
                ImmutableList.of(singleColumn(FIXED_INT_64, 0), singleColumn(DOUBLE, 1)),
                Ordering.from(new FieldOrderedTupleComparator(ImmutableList.of(0), ImmutableList.of(SortOrder.ASC_NULLS_LAST))),
                Optional.<Integer>absent(),
                false);

        Operator operator = operatorFactory.createOperator(driverContext);
View Full Code Here

Examples of com.facebook.presto.tuple.FieldOrderedTupleComparator

            for (Symbol symbol : orderBySymbols) {
                sortChannels.add(source.getLayout().get(symbol).getChannel());
                sortOrders.add(node.getOrderings().get(symbol));
            }

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

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

            Optional<Integer> sampleWeightChannel = node.getSampleWeight().transform(source.channelGetter());
View Full Code Here

Examples of com.facebook.presto.tuple.FieldOrderedTupleComparator

        OperatorFactory tableScanOperator = createTableScanOperator(0, "orders", "totalprice");
        TopNOperatorFactory topNOperator = new TopNOperatorFactory(
                1,
                100,
                ImmutableList.of(singleColumn(Type.DOUBLE, 0)),
                Ordering.from(new FieldOrderedTupleComparator(ImmutableList.of(0), ImmutableList.of(SortOrder.DESC_NULLS_LAST))),
                Optional.<Integer>absent(),
                false);
        return ImmutableList.of(tableScanOperator, topNOperator);
    }
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.