Search in sources :

Example 1 with OptimizedPartitionedOutputFactory

use of com.facebook.presto.operator.repartition.OptimizedPartitionedOutputOperator.OptimizedPartitionedOutputFactory in project presto by prestodb.

the class TestOptimizedPartitionedOutputOperator method createOptimizedPartitionedOutputOperator.

private OptimizedPartitionedOutputOperator createOptimizedPartitionedOutputOperator(List<Type> types, List<Integer> partitionChannel, PartitionFunction partitionFunction, PartitionedOutputBuffer buffer, OptionalInt nullChannel, DataSize maxMemory) {
    PagesSerdeFactory serdeFactory = new PagesSerdeFactory(new BlockEncodingManager(), false);
    OutputPartitioning outputPartitioning = new OutputPartitioning(partitionFunction, partitionChannel, ImmutableList.of(Optional.empty()), false, nullChannel);
    OptimizedPartitionedOutputFactory operatorFactory = new OptimizedPartitionedOutputFactory(buffer, maxMemory);
    return (OptimizedPartitionedOutputOperator) operatorFactory.createOutputOperator(0, new PlanNodeId("plan-node-0"), types, Function.identity(), Optional.of(outputPartitioning), serdeFactory).createOperator(createDriverContext());
}
Also used : PlanNodeId(com.facebook.presto.spi.plan.PlanNodeId) PagesSerdeFactory(com.facebook.presto.execution.buffer.PagesSerdeFactory) OptimizedPartitionedOutputFactory(com.facebook.presto.operator.repartition.OptimizedPartitionedOutputOperator.OptimizedPartitionedOutputFactory) BlockEncodingManager(com.facebook.presto.common.block.BlockEncodingManager) OutputPartitioning(com.facebook.presto.sql.planner.OutputPartitioning)

Aggregations

BlockEncodingManager (com.facebook.presto.common.block.BlockEncodingManager)1 PagesSerdeFactory (com.facebook.presto.execution.buffer.PagesSerdeFactory)1 OptimizedPartitionedOutputFactory (com.facebook.presto.operator.repartition.OptimizedPartitionedOutputOperator.OptimizedPartitionedOutputFactory)1 PlanNodeId (com.facebook.presto.spi.plan.PlanNodeId)1 OutputPartitioning (com.facebook.presto.sql.planner.OutputPartitioning)1