use of com.facebook.presto.sql.planner.iterative.rule.ReorderJoins.JoinEnumerator in project presto by prestodb.
the class TestJoinEnumerator method testDoesNotCreateJoinWhenPartitionedOnCrossJoin.
@Test
public void testDoesNotCreateJoinWhenPartitionedOnCrossJoin() {
PlanNodeIdAllocator idAllocator = new PlanNodeIdAllocator();
PlanBuilder p = new PlanBuilder(TEST_SESSION, idAllocator, queryRunner.getMetadata());
VariableReferenceExpression a1 = p.variable("A1");
VariableReferenceExpression b1 = p.variable("B1");
MultiJoinNode multiJoinNode = new MultiJoinNode(new LinkedHashSet<>(ImmutableList.of(p.values(a1), p.values(b1))), TRUE_CONSTANT, ImmutableList.of(a1, b1));
JoinEnumerator joinEnumerator = new JoinEnumerator(new CostComparator(1, 1, 1), multiJoinNode.getFilter(), createContext(), determinismEvaluator, functionResolution, metadata);
JoinEnumerationResult actual = joinEnumerator.createJoinAccordingToPartitioning(multiJoinNode.getSources(), multiJoinNode.getOutputVariables(), ImmutableSet.of(0));
assertFalse(actual.getPlanNode().isPresent());
assertEquals(actual.getCost(), PlanCostEstimate.infinite());
}
Aggregations