use of io.prestosql.RowPagesBuilder in project hetu-core by openlookeng.
the class TestHashSemiJoinOperator method testMemoryLimit.
@Test(dataProvider = "hashEnabledValues", expectedExceptions = ExceededMemoryLimitException.class, expectedExceptionsMessageRegExp = "Query exceeded per-node user memory limit of.*")
public void testMemoryLimit(boolean hashEnabled) {
DriverContext driverContext = createTaskContext(executor, scheduledExecutor, TEST_SESSION, new DataSize(100, BYTE)).addPipelineContext(0, true, true, false).addDriverContext();
OperatorContext operatorContext = driverContext.addOperatorContext(0, new PlanNodeId("test"), ValuesOperator.class.getSimpleName());
List<Type> buildTypes = ImmutableList.of(BIGINT);
RowPagesBuilder rowPagesBuilder = rowPagesBuilder(hashEnabled, Ints.asList(0), buildTypes);
Operator buildOperator = createValuesOperator(operatorContext, rowPagesBuilder.addSequencePage(10000, 20).build());
SetBuilderOperatorFactory setBuilderOperatorFactory = new SetBuilderOperatorFactory(1, new PlanNodeId("test"), buildTypes.get(0), 0, rowPagesBuilder.getHashChannel(), 10, new JoinCompiler(createTestMetadataManager()));
Operator setBuilderOperator = setBuilderOperatorFactory.createOperator(driverContext);
Driver driver = Driver.createDriver(driverContext, buildOperator, setBuilderOperator);
while (!driver.isFinished()) {
driver.process();
}
}
use of io.prestosql.RowPagesBuilder in project hetu-core by openlookeng.
the class TestDistinctLimitOperator method testDistinctLimitSnapshot.
@Test
public void testDistinctLimitSnapshot() {
RowPagesBuilder rowPagesBuilder = rowPagesBuilder(true, Ints.asList(0), BIGINT);
List<Page> input = rowPagesBuilder.addSequencePage(3, 1).addSequencePage(5, 2).build();
OperatorFactory operatorFactory = new DistinctLimitOperator.DistinctLimitOperatorFactory(0, new PlanNodeId("test"), rowPagesBuilder.getTypes(), Ints.asList(0), 5, rowPagesBuilder.getHashChannel(), joinCompiler);
MaterializedResult expected = resultBuilder(driverContext.getSession(), BIGINT).row(1L).row(2L).row(3L).row(4L).row(5L).build();
assertOperatorEqualsWithSimpleSelfStateComparison(operatorFactory, driverContext, input, expected, true, ImmutableList.of(1), createExpectedMapping());
}
Aggregations