use of io.trino.operator.join.NestedLoopJoinOperator.NestedLoopJoinOperatorFactory in project trino by trinodb.
the class TestNestedLoopJoinOperator method testCrossJoinWithNullProbe.
@Test
public void testCrossJoinWithNullProbe() {
TaskContext taskContext = createTaskContext();
// build
List<Type> buildTypes = ImmutableList.of(VARCHAR);
RowPagesBuilder buildPages = rowPagesBuilder(buildTypes).row("a").row("b");
// probe
List<Type> probeTypes = ImmutableList.of(VARCHAR);
RowPagesBuilder probePages = rowPagesBuilder(probeTypes);
List<Page> probeInput = probePages.row("A").row((String) null).row((String) null).row("A").row("B").build();
NestedLoopJoinOperatorFactory joinOperatorFactory = newJoinOperatorFactoryWithCompletedBuild(taskContext, buildPages, ImmutableList.of(0), ImmutableList.of(0));
// expected
MaterializedResult expected = resultBuilder(taskContext.getSession(), concat(probeTypes, buildPages.getTypes())).row("A", "a").row(null, "a").row(null, "a").row("A", "a").row("B", "a").row("A", "b").row(null, "b").row(null, "b").row("A", "b").row("B", "b").build();
assertOperatorEquals(joinOperatorFactory, taskContext.addPipelineContext(0, true, true, false).addDriverContext(), probeInput, expected);
}
Aggregations