Search in sources :

Example 6 with PlanFragment

use of com.facebook.presto.sql.planner.PlanFragment in project presto by prestodb.

the class TestPhasedExecutionSchedule method testBroadcastJoin.

@Test
public void testBroadcastJoin() throws Exception {
    PlanFragment buildFragment = createTableScanPlanFragment("build");
    PlanFragment joinFragment = createBroadcastJoinPlanFragment("join", buildFragment);
    List<Set<PlanFragmentId>> phases = PhasedExecutionSchedule.extractPhases(ImmutableList.of(joinFragment, buildFragment));
    assertEquals(phases, ImmutableList.of(ImmutableSet.of(joinFragment.getId(), buildFragment.getId())));
}
Also used : ImmutableSet(com.google.common.collect.ImmutableSet) Set(java.util.Set) PlanFragment(com.facebook.presto.sql.planner.PlanFragment) Test(org.testng.annotations.Test)

Example 7 with PlanFragment

use of com.facebook.presto.sql.planner.PlanFragment in project presto by prestodb.

the class TestPhasedExecutionSchedule method testRightJoin.

@Test
public void testRightJoin() throws Exception {
    PlanFragment buildFragment = createTableScanPlanFragment("build");
    PlanFragment probeFragment = createTableScanPlanFragment("probe");
    PlanFragment joinFragment = createJoinPlanFragment(RIGHT, "join", buildFragment, probeFragment);
    List<Set<PlanFragmentId>> phases = PhasedExecutionSchedule.extractPhases(ImmutableList.of(joinFragment, buildFragment, probeFragment));
    assertEquals(phases, ImmutableList.of(ImmutableSet.of(joinFragment.getId()), ImmutableSet.of(buildFragment.getId()), ImmutableSet.of(probeFragment.getId())));
}
Also used : ImmutableSet(com.google.common.collect.ImmutableSet) Set(java.util.Set) PlanFragment(com.facebook.presto.sql.planner.PlanFragment) Test(org.testng.annotations.Test)

Example 8 with PlanFragment

use of com.facebook.presto.sql.planner.PlanFragment in project presto by prestodb.

the class TestPhasedExecutionSchedule method testJoin.

@Test
public void testJoin() throws Exception {
    PlanFragment buildFragment = createTableScanPlanFragment("build");
    PlanFragment probeFragment = createTableScanPlanFragment("probe");
    PlanFragment joinFragment = createJoinPlanFragment(INNER, "join", buildFragment, probeFragment);
    List<Set<PlanFragmentId>> phases = PhasedExecutionSchedule.extractPhases(ImmutableList.of(joinFragment, buildFragment, probeFragment));
    assertEquals(phases, ImmutableList.of(ImmutableSet.of(joinFragment.getId()), ImmutableSet.of(buildFragment.getId()), ImmutableSet.of(probeFragment.getId())));
}
Also used : ImmutableSet(com.google.common.collect.ImmutableSet) Set(java.util.Set) PlanFragment(com.facebook.presto.sql.planner.PlanFragment) Test(org.testng.annotations.Test)

Example 9 with PlanFragment

use of com.facebook.presto.sql.planner.PlanFragment in project presto by prestodb.

the class TestPhasedExecutionSchedule method testExchange.

@Test
public void testExchange() throws Exception {
    PlanFragment aFragment = createTableScanPlanFragment("a");
    PlanFragment bFragment = createTableScanPlanFragment("b");
    PlanFragment cFragment = createTableScanPlanFragment("c");
    PlanFragment exchangeFragment = createExchangePlanFragment("exchange", aFragment, bFragment, cFragment);
    List<Set<PlanFragmentId>> phases = PhasedExecutionSchedule.extractPhases(ImmutableList.of(aFragment, bFragment, cFragment, exchangeFragment));
    assertEquals(phases, ImmutableList.of(ImmutableSet.of(exchangeFragment.getId()), ImmutableSet.of(aFragment.getId()), ImmutableSet.of(bFragment.getId()), ImmutableSet.of(cFragment.getId())));
}
Also used : ImmutableSet(com.google.common.collect.ImmutableSet) Set(java.util.Set) PlanFragment(com.facebook.presto.sql.planner.PlanFragment) Test(org.testng.annotations.Test)

Example 10 with PlanFragment

use of com.facebook.presto.sql.planner.PlanFragment in project presto by prestodb.

the class TestPhasedExecutionSchedule method testUnion.

@Test
public void testUnion() throws Exception {
    PlanFragment aFragment = createTableScanPlanFragment("a");
    PlanFragment bFragment = createTableScanPlanFragment("b");
    PlanFragment cFragment = createTableScanPlanFragment("c");
    PlanFragment unionFragment = createUnionPlanFragment("union", aFragment, bFragment, cFragment);
    List<Set<PlanFragmentId>> phases = PhasedExecutionSchedule.extractPhases(ImmutableList.of(aFragment, bFragment, cFragment, unionFragment));
    assertEquals(phases, ImmutableList.of(ImmutableSet.of(unionFragment.getId()), ImmutableSet.of(aFragment.getId()), ImmutableSet.of(bFragment.getId()), ImmutableSet.of(cFragment.getId())));
}
Also used : ImmutableSet(com.google.common.collect.ImmutableSet) Set(java.util.Set) PlanFragment(com.facebook.presto.sql.planner.PlanFragment) Test(org.testng.annotations.Test)

Aggregations

PlanFragment (com.facebook.presto.sql.planner.PlanFragment)15 ImmutableSet (com.google.common.collect.ImmutableSet)8 Set (java.util.Set)8 PlanFragmentId (com.facebook.presto.sql.planner.plan.PlanFragmentId)6 Test (org.testng.annotations.Test)5 PartitioningScheme (com.facebook.presto.sql.planner.PartitioningScheme)3 Symbol (com.facebook.presto.sql.planner.Symbol)3 PlanNodeId (com.facebook.presto.sql.planner.plan.PlanNodeId)3 TableHandle (com.facebook.presto.metadata.TableHandle)2 TestingColumnHandle (com.facebook.presto.sql.planner.TestingColumnHandle)2 TestingTableHandle (com.facebook.presto.sql.planner.TestingTableHandle)2 JoinNode (com.facebook.presto.sql.planner.plan.JoinNode)2 PlanVisitor (com.facebook.presto.sql.planner.plan.PlanVisitor)2 RemoteSourceNode (com.facebook.presto.sql.planner.plan.RemoteSourceNode)2 TableScanNode (com.facebook.presto.sql.planner.plan.TableScanNode)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)2 ImmutableList (com.google.common.collect.ImmutableList)2 HashSet (java.util.HashSet)2 TaskSource (com.facebook.presto.TaskSource)1 FailureInfo (com.facebook.presto.client.FailureInfo)1