use of com.facebook.presto.operator.repartition.PartitionedOutputOperator in project presto by prestodb.
the class TestPartitionedOutputOperator method testOutputForPageWithDictionary.
@Test
public void testOutputForPageWithDictionary() {
PartitionedOutputOperator partitionedOutputOperator = createPartitionedOutputOperator(false);
for (int i = 0; i < PAGE_COUNT; i++) {
partitionedOutputOperator.addInput(new Page(TESTING_DICTIONARY_BLOCK));
}
partitionedOutputOperator.finish();
OperatorContext operatorContext = partitionedOutputOperator.getOperatorContext();
assertEquals(operatorContext.getOutputDataSize().getTotalCount(), PAGE_COUNT * TESTING_PAGE.getSizeInBytes());
assertEquals(operatorContext.getOutputPositions().getTotalCount(), PAGE_COUNT * TESTING_PAGE.getPositionCount());
}
use of com.facebook.presto.operator.repartition.PartitionedOutputOperator in project presto by prestodb.
the class TestPartitionedOutputOperator method testOutputForSimplePage.
@Test
public void testOutputForSimplePage() {
PartitionedOutputOperator partitionedOutputOperator = createPartitionedOutputOperator(false);
for (int i = 0; i < PAGE_COUNT; i++) {
partitionedOutputOperator.addInput(TESTING_PAGE);
}
partitionedOutputOperator.finish();
OperatorContext operatorContext = partitionedOutputOperator.getOperatorContext();
assertEquals(operatorContext.getOutputDataSize().getTotalCount(), PAGE_COUNT * TESTING_PAGE.getSizeInBytes());
assertEquals(operatorContext.getOutputPositions().getTotalCount(), PAGE_COUNT * TESTING_PAGE.getPositionCount());
}
use of com.facebook.presto.operator.repartition.PartitionedOutputOperator in project presto by prestodb.
the class TestPartitionedOutputOperator method testOutputForPageWithRunLength.
@Test
public void testOutputForPageWithRunLength() {
PartitionedOutputOperator partitionedOutputOperator = createPartitionedOutputOperator(false);
for (int i = 0; i < PAGE_COUNT; i++) {
partitionedOutputOperator.addInput(new Page(TESTING_RLE_BLOCK));
}
partitionedOutputOperator.finish();
OperatorContext operatorContext = partitionedOutputOperator.getOperatorContext();
assertEquals(operatorContext.getOutputDataSize().getTotalCount(), PAGE_COUNT * TESTING_PAGE.getSizeInBytes());
assertEquals(operatorContext.getOutputPositions().getTotalCount(), PAGE_COUNT * TESTING_PAGE.getPositionCount());
}
use of com.facebook.presto.operator.repartition.PartitionedOutputOperator in project presto by prestodb.
the class TestPartitionedOutputOperator method testOutputForPageWithRunLengthAndReplication.
@Test
public void testOutputForPageWithRunLengthAndReplication() {
PartitionedOutputOperator partitionedOutputOperator = createPartitionedOutputOperator(true);
for (int i = 0; i < PAGE_COUNT; i++) {
partitionedOutputOperator.addInput(new Page(POSITIONS_PER_PAGE, NULL_BLOCK, TESTING_RLE_BLOCK));
}
partitionedOutputOperator.finish();
OperatorContext operatorContext = partitionedOutputOperator.getOperatorContext();
assertEquals(operatorContext.getOutputDataSize().getTotalCount(), PAGE_COUNT * PARTITION_COUNT * TESTING_PAGE_WITH_NULL_BLOCK.getSizeInBytes());
assertEquals(operatorContext.getOutputPositions().getTotalCount(), PAGE_COUNT * PARTITION_COUNT * TESTING_PAGE_WITH_NULL_BLOCK.getPositionCount());
}
use of com.facebook.presto.operator.repartition.PartitionedOutputOperator in project presto by prestodb.
the class TestPartitionedOutputOperator method testOutputForPageWithDictionaryAndReplication.
@Test
public void testOutputForPageWithDictionaryAndReplication() {
PartitionedOutputOperator partitionedOutputOperator = createPartitionedOutputOperator(true);
for (int i = 0; i < PAGE_COUNT; i++) {
partitionedOutputOperator.addInput(new Page(POSITIONS_PER_PAGE, NULL_BLOCK, TESTING_DICTIONARY_BLOCK));
}
partitionedOutputOperator.finish();
OperatorContext operatorContext = partitionedOutputOperator.getOperatorContext();
assertEquals(operatorContext.getOutputDataSize().getTotalCount(), PAGE_COUNT * PARTITION_COUNT * TESTING_PAGE_WITH_NULL_BLOCK.getSizeInBytes());
assertEquals(operatorContext.getOutputPositions().getTotalCount(), PAGE_COUNT * PARTITION_COUNT * TESTING_PAGE_WITH_NULL_BLOCK.getPositionCount());
}
Aggregations