use of io.prestosql.sql.planner.iterative.rule.ReorderJoins.JoinEnumerator in project hetu-core by openlookeng.
the class TestJoinEnumerator method testDoesNotCreateJoinWhenPartitionedOnCrossJoin.
@Test
public void testDoesNotCreateJoinWhenPartitionedOnCrossJoin() {
PlanNodeIdAllocator idAllocator = new PlanNodeIdAllocator();
PlanBuilder p = new PlanBuilder(idAllocator, queryRunner.getMetadata());
Symbol a1 = p.symbol("A1");
Symbol b1 = p.symbol("B1");
LogicalRowExpressions logicalRowExpressions = new LogicalRowExpressions(new RowExpressionDeterminismEvaluator(queryRunner.getMetadata()), new FunctionResolution(queryRunner.getMetadata().getFunctionAndTypeManager()), queryRunner.getMetadata().getFunctionAndTypeManager());
MultiJoinNode multiJoinNode = new MultiJoinNode(new LinkedHashSet<>(ImmutableList.of(p.values(a1), p.values(b1))), TRUE_CONSTANT, ImmutableList.of(a1, b1), logicalRowExpressions);
JoinEnumerator joinEnumerator = new JoinEnumerator(new CostComparator(1, 1, 1), multiJoinNode.getFilter(), createContext(), queryRunner.getMetadata(), logicalRowExpressions);
JoinEnumerationResult actual = joinEnumerator.createJoinAccordingToPartitioning(multiJoinNode.getSources(), multiJoinNode.getOutputSymbols(), ImmutableSet.of(0));
assertFalse(actual.getPlanNode().isPresent());
assertEquals(actual.getCost(), PlanCostEstimate.infinite());
}
Aggregations