use of com.facebook.presto.operator.LimitOperator.LimitOperatorFactory in project presto by prestodb.
the class TestLimitOperator method testLimitWithPageAlignment.
@Test
public void testLimitWithPageAlignment() {
List<Page> input = rowPagesBuilder(BIGINT).addSequencePage(3, 1).addSequencePage(2, 4).addSequencePage(2, 6).build();
OperatorFactory operatorFactory = new LimitOperatorFactory(0, new PlanNodeId("test"), 5);
MaterializedResult expected = resultBuilder(driverContext.getSession(), BIGINT).page(createSequencePage(ImmutableList.of(BIGINT), 3, 1)).page(createSequencePage(ImmutableList.of(BIGINT), 2, 4)).build();
OperatorAssertion.assertOperatorEquals(operatorFactory, driverContext, input, expected);
}
use of com.facebook.presto.operator.LimitOperator.LimitOperatorFactory in project presto by prestodb.
the class OrderByBenchmark method createOperatorFactories.
@Override
protected List<? extends OperatorFactory> createOperatorFactories() {
List<Type> tableScanTypes = getColumnTypes("orders", "totalprice", "clerk");
OperatorFactory tableScanOperator = createTableScanOperator(0, new PlanNodeId("test"), "orders", "totalprice", "clerk");
LimitOperatorFactory limitOperator = new LimitOperatorFactory(1, new PlanNodeId("test"), ROWS);
OrderByOperatorFactory orderByOperator = new OrderByOperatorFactory(2, new PlanNodeId("test"), tableScanTypes, ImmutableList.of(1), ROWS, ImmutableList.of(0), ImmutableList.of(ASC_NULLS_LAST), new PagesIndex.TestingFactory(false), false, Optional.empty(), new OrderingCompiler());
return ImmutableList.of(tableScanOperator, limitOperator, orderByOperator);
}
use of com.facebook.presto.operator.LimitOperator.LimitOperatorFactory in project presto by prestodb.
the class TestLimitOperator method testLimitWithBlockView.
@Test
public void testLimitWithBlockView() {
List<Page> input = rowPagesBuilder(BIGINT).addSequencePage(3, 1).addSequencePage(2, 4).addSequencePage(2, 6).build();
OperatorFactory operatorFactory = new LimitOperatorFactory(0, new PlanNodeId("test"), 6);
List<Page> expected = rowPagesBuilder(BIGINT).addSequencePage(3, 1).addSequencePage(2, 4).addSequencePage(1, 6).build();
OperatorAssertion.assertOperatorEquals(operatorFactory, ImmutableList.of(BIGINT), driverContext, input, expected);
}
Aggregations