Package com.facebook.presto.operator.AlignmentOperator

Examples of com.facebook.presto.operator.AlignmentOperator.AlignmentOperatorFactory


    @Override
    protected List<? extends OperatorFactory> createOperatorFactories()
    {
        BlockIterable blockIterable = getBlockIterable("orders", "totalprice", BlocksFileEncoding.RAW);
        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))),
View Full Code Here


    @Override
    protected List<? extends OperatorFactory> createOperatorFactories()
    {
        BlockIterable blockIterable = getBlockIterable("orders", "totalprice", BlocksFileEncoding.RAW);
        AlignmentOperatorFactory alignmentOperator = new AlignmentOperatorFactory(0, blockIterable);
        AggregationOperatorFactory aggregationOperator = new AggregationOperatorFactory(1, Step.SINGLE, ImmutableList.of(aggregation(DOUBLE_SUM, new Input(0))));
        return ImmutableList.of(alignmentOperator, aggregationOperator);
    }
View Full Code Here

    @Override
    protected List<? extends OperatorFactory> createOperatorFactories()
    {
        BlockIterable blockIterable = getBlockIterable("orders", "totalprice", BlocksFileEncoding.RAW);
        AlignmentOperatorFactory alignmentOperator = new AlignmentOperatorFactory(0, blockIterable);

        return ImmutableList.of(alignmentOperator);
    }
View Full Code Here

    protected List<? extends OperatorFactory> createOperatorFactories()
    {
        BlockIterable orderStatusBlockIterable = getBlockIterable("orders", "orderstatus", BlocksFileEncoding.RAW);
        BlockIterable totalPriceBlockIterable = getBlockIterable("orders", "totalprice", BlocksFileEncoding.RAW);

        AlignmentOperatorFactory alignmentOperator = new AlignmentOperatorFactory(0, orderStatusBlockIterable, totalPriceBlockIterable);
        HashAggregationOperatorFactory aggregationOperator = new HashAggregationOperatorFactory(1,
                ImmutableList.of(alignmentOperator.getTupleInfos().get(0)),
                Ints.asList(0),
                Step.SINGLE,
                ImmutableList.of(aggregation(DOUBLE_SUM, new Input(1))),
                100_000);
        return ImmutableList.of(alignmentOperator, aggregationOperator);
View Full Code Here

        BlockIterable extendedPrice = getBlockIterable("lineitem", "extendedprice", BlocksFileEncoding.RAW);
        BlockIterable discount = getBlockIterable("lineitem", "discount", BlocksFileEncoding.RAW);
        BlockIterable shipDate = getBlockIterable("lineitem", "shipdate", BlocksFileEncoding.RAW);
        BlockIterable quantity = getBlockIterable("lineitem", "quantity", BlocksFileEncoding.RAW);

        AlignmentOperatorFactory alignmentOperator = new AlignmentOperatorFactory(0, extendedPrice, discount, shipDate, quantity);

        TpchQuery6OperatorFactory tpchQuery6Operator = new TpchQuery6OperatorFactory(1);

        AggregationOperatorFactory aggregationOperator = new AggregationOperatorFactory(
                2,
View Full Code Here

        }
        storageManager.commit(fileHandles);

        assertTrue(storageManager.shardExists(shardUuid));

        AlignmentOperatorFactory factory = new AlignmentOperatorFactory(0,
                storageManager.getBlocks(shardUuid, columnHandles.get(0)),
                storageManager.getBlocks(shardUuid, columnHandles.get(1)));
        Operator operator = factory.createOperator(driverContext);

        // materialize pages to force comparision only on contents and not page boundaries
        MaterializedResult expected = toMaterializedResult(operator.getTupleInfos(), pages);

        OperatorAssertion.assertOperatorEquals(operator, expected);
View Full Code Here

    protected List<Driver> createDrivers(TaskContext taskContext)
    {
        BlockIterable orderOrderKey = getBlockIterable("orders", "orderkey", BlocksFileEncoding.RAW);
        BlockIterable totalPrice = getBlockIterable("orders", "totalprice", BlocksFileEncoding.RAW);

        AlignmentOperatorFactory ordersTableScan = new AlignmentOperatorFactory(0, orderOrderKey, totalPrice);
        HashBuilderOperatorFactory hashBuilder = new HashBuilderOperatorFactory(1, ordersTableScan.getTupleInfos(), Ints.asList(0), 1_500_000);

        DriverFactory driverFactory = new DriverFactory(true, true, ordersTableScan, hashBuilder);
        Driver driver = driverFactory.createDriver(taskContext.addPipelineContext(true, true).addDriverContext());
        return ImmutableList.of(driver);
    }
View Full Code Here

    {
        // hash build
        BlockIterable orderOrderKey = getBlockIterable("orders", "orderkey", BlocksFileEncoding.RAW);
        BlockIterable totalPrice = getBlockIterable("orders", "totalprice", BlocksFileEncoding.RAW);

        AlignmentOperatorFactory ordersTableScan = new AlignmentOperatorFactory(0, orderOrderKey, totalPrice);
        HashBuilderOperatorFactory hashBuilder = new HashBuilderOperatorFactory(1, ordersTableScan.getTupleInfos(), Ints.asList(0), 1_500_000);

        DriverFactory hashBuildDriverFactory = new DriverFactory(true, false, ordersTableScan, hashBuilder);
        Driver hashBuildDriver = hashBuildDriverFactory.createDriver(taskContext.addPipelineContext(true, false).addDriverContext());

        // join
        BlockIterable lineItemOrderKey = getBlockIterable("lineitem", "orderkey", BlocksFileEncoding.RAW);
        BlockIterable lineNumber = getBlockIterable("lineitem", "quantity", BlocksFileEncoding.RAW);
        AlignmentOperatorFactory lineItemTableScan = new AlignmentOperatorFactory(0, lineItemOrderKey, lineNumber);

        HashJoinOperatorFactory joinOperator = HashJoinOperator.innerJoin(1, hashBuilder.getHashSupplier(), lineItemTableScan.getTupleInfos(), Ints.asList(0));

        NullOutputOperatorFactory output = new NullOutputOperatorFactory(2, joinOperator.getTupleInfos());

        DriverFactory joinDriverFactory = new DriverFactory(true, true, lineItemTableScan, joinOperator, output);
        Driver joinDriver = joinDriverFactory.createDriver(taskContext.addPipelineContext(true, true).addDriverContext());
View Full Code Here

    @Override
    protected List<? extends OperatorFactory> createOperatorFactories()
    {
        BlockIterable blockIterable = getBlockIterable("orders", "orderkey", BlocksFileEncoding.RAW);
        AlignmentOperatorFactory alignmentOperator = new AlignmentOperatorFactory(0, blockIterable);
        AggregationOperatorFactory aggregationOperator = new AggregationOperatorFactory(1, Step.SINGLE, ImmutableList.of(aggregation(COUNT, new Input(0))));
        return ImmutableList.of(alignmentOperator, aggregationOperator);
    }
View Full Code Here

        }
        storageManager.commit(fileHandles);

        assertTrue(storageManager.shardExists(shardUuid));

        AlignmentOperatorFactory factory = new AlignmentOperatorFactory(0,
                storageManager.getBlocks(shardUuid, columnHandles.get(0)),
                storageManager.getBlocks(shardUuid, columnHandles.get(1)));
        Operator operator = factory.createOperator(driverContext);

        // materialize pages to force comparision only on contents and not page boundaries
        MaterializedResult expected = toMaterializedResult(operator.getOperatorContext().getSession(), operator.getTypes(), pages);

        OperatorAssertion.assertOperatorEquals(operator, expected);
View Full Code Here

TOP

Related Classes of com.facebook.presto.operator.AlignmentOperator.AlignmentOperatorFactory

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.