Examples of DualInputPlanNode


Examples of org.apache.flink.compiler.plan.DualInputPlanNode

      Plan plan = getJavaTestPlan(false, true);
     
      OptimizedPlan oPlan = compileNoStats(plan);
 
      OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(oPlan);
      DualInputPlanNode joinWithInvariantNode = resolver.getNode(JOIN_WITH_INVARIANT_NAME);
      DualInputPlanNode joinWithSolutionSetNode = resolver.getNode(JOIN_WITH_SOLUTION_SET);
      SingleInputPlanNode worksetReducer = resolver.getNode(NEXT_WORKSET_REDUCER_NAME);
      SingleInputPlanNode deltaMapper = resolver.getNode(SOLUTION_DELTA_MAPPER_NAME);
     
      // iteration preserves partitioning in reducer, so the first partitioning is out of the loop,
      // the in-loop partitioning is before the final reducer
     
      // verify joinWithInvariant
      assertEquals(ShipStrategyType.FORWARD, joinWithInvariantNode.getInput1().getShipStrategy());
      assertEquals(ShipStrategyType.PARTITION_HASH, joinWithInvariantNode.getInput2().getShipStrategy());
      assertEquals(new FieldList(1, 2), joinWithInvariantNode.getKeysForInput1());
      assertEquals(new FieldList(1, 2), joinWithInvariantNode.getKeysForInput2());
     
      // verify joinWithSolutionSet
      assertEquals(ShipStrategyType.PARTITION_HASH, joinWithSolutionSetNode.getInput1().getShipStrategy());
      assertEquals(ShipStrategyType.FORWARD, joinWithSolutionSetNode.getInput2().getShipStrategy());
      assertEquals(new FieldList(1, 0), joinWithSolutionSetNode.getKeysForInput1());
     
     
      // verify reducer
      assertEquals(ShipStrategyType.PARTITION_HASH, worksetReducer.getInput().getShipStrategy());
      assertEquals(new FieldList(1, 2), worksetReducer.getKeys(0));
View Full Code Here

Examples of org.apache.flink.compiler.plan.DualInputPlanNode

      Plan plan = getJavaTestPlan(false, false);
     
      OptimizedPlan oPlan = compileNoStats(plan);
     
      OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(oPlan);
      DualInputPlanNode joinWithInvariantNode = resolver.getNode(JOIN_WITH_INVARIANT_NAME);
      DualInputPlanNode joinWithSolutionSetNode = resolver.getNode(JOIN_WITH_SOLUTION_SET);
      SingleInputPlanNode worksetReducer = resolver.getNode(NEXT_WORKSET_REDUCER_NAME);
     
      // iteration preserves partitioning in reducer, so the first partitioning is out of the loop,
      // the in-loop partitioning is before the final reducer
     
      // verify joinWithInvariant
      assertEquals(ShipStrategyType.FORWARD, joinWithInvariantNode.getInput1().getShipStrategy());
      assertEquals(ShipStrategyType.PARTITION_HASH, joinWithInvariantNode.getInput2().getShipStrategy());
      assertEquals(new FieldList(1, 2), joinWithInvariantNode.getKeysForInput1());
      assertEquals(new FieldList(1, 2), joinWithInvariantNode.getKeysForInput2());
     
      // verify joinWithSolutionSet
      assertEquals(ShipStrategyType.PARTITION_HASH, joinWithSolutionSetNode.getInput1().getShipStrategy());
      assertEquals(ShipStrategyType.FORWARD, joinWithSolutionSetNode.getInput2().getShipStrategy());
      assertEquals(new FieldList(1, 0), joinWithSolutionSetNode.getKeysForInput1());
     
      // verify reducer
      assertEquals(ShipStrategyType.PARTITION_HASH, worksetReducer.getInput().getShipStrategy());
      assertEquals(new FieldList(1, 2), worksetReducer.getKeys(0));
     
      // verify solution delta
      assertEquals(2, joinWithSolutionSetNode.getOutgoingChannels().size());
      assertEquals(ShipStrategyType.PARTITION_HASH, joinWithSolutionSetNode.getOutgoingChannels().get(0).getShipStrategy());
      assertEquals(ShipStrategyType.PARTITION_HASH, joinWithSolutionSetNode.getOutgoingChannels().get(1).getShipStrategy());
     
      new NepheleJobGraphGenerator().compileJobGraph(oPlan);
    }
    catch (Exception e) {
      System.err.println(e.getMessage());
View Full Code Here

Examples of org.apache.flink.compiler.plan.DualInputPlanNode

     
      OptimizedPlan oPlan = compileNoStats(plan);
 
     
      OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(oPlan);
      DualInputPlanNode joinWithInvariantNode = resolver.getNode(JOIN_WITH_INVARIANT_NAME);
      DualInputPlanNode joinWithSolutionSetNode = resolver.getNode(JOIN_WITH_SOLUTION_SET);
      SingleInputPlanNode worksetReducer = resolver.getNode(NEXT_WORKSET_REDUCER_NAME);
     
      // iteration preserves partitioning in reducer, so the first partitioning is out of the loop,
      // the in-loop partitioning is before the final reducer
     
      // verify joinWithInvariant
      assertEquals(ShipStrategyType.FORWARD, joinWithInvariantNode.getInput1().getShipStrategy());
      assertEquals(ShipStrategyType.PARTITION_HASH, joinWithInvariantNode.getInput2().getShipStrategy());
      assertEquals(new FieldList(1, 2), joinWithInvariantNode.getKeysForInput1());
      assertEquals(new FieldList(1, 2), joinWithInvariantNode.getKeysForInput2());
     
      // verify joinWithSolutionSet
      assertEquals(ShipStrategyType.PARTITION_HASH, joinWithSolutionSetNode.getInput1().getShipStrategy());
      assertEquals(ShipStrategyType.FORWARD, joinWithSolutionSetNode.getInput2().getShipStrategy());
      assertEquals(new FieldList(1, 0), joinWithSolutionSetNode.getKeysForInput1());
     
      // verify reducer
      assertEquals(ShipStrategyType.FORWARD, worksetReducer.getInput().getShipStrategy());
      assertEquals(new FieldList(1, 2), worksetReducer.getKeys(0));
     
     
      // verify solution delta
      assertEquals(1, joinWithSolutionSetNode.getOutgoingChannels().size());
      assertEquals(ShipStrategyType.FORWARD, joinWithSolutionSetNode.getOutgoingChannels().get(0).getShipStrategy());
     
      new NepheleJobGraphGenerator().compileJobGraph(oPlan);
    }
    catch (Exception e) {
      System.err.println(e.getMessage());
View Full Code Here

Examples of org.apache.flink.compiler.plan.DualInputPlanNode

    oPlan.accept(new Visitor<PlanNode>() {
     
      @Override
      public boolean preVisit(PlanNode visitable) {
        if (visitable instanceof DualInputPlanNode) {
          DualInputPlanNode node = (DualInputPlanNode) visitable;
          Channel c1 = node.getInput1();
          Channel c2 = node.getInput2();
         
          Assert.assertEquals("Incompatible shipping strategy chosen for match", ShipStrategyType.FORWARD, c1.getShipStrategy());
          Assert.assertEquals("Incompatible shipping strategy chosen for match", ShipStrategyType.PARTITION_HASH, c2.getShipStrategy());
          return false;
        }
View Full Code Here

Examples of org.apache.flink.compiler.plan.DualInputPlanNode

public class JoinTranslationTest extends CompilerTestBase {

  @Test
  public void testBroadcastHashFirstTest() {
    try {
      DualInputPlanNode node = createPlanAndGetJoinNode(JoinHint.BROADCAST_HASH_FIRST);
      assertEquals(ShipStrategyType.BROADCAST, node.getInput1().getShipStrategy());
      assertEquals(ShipStrategyType.FORWARD, node.getInput2().getShipStrategy());
      assertEquals(DriverStrategy.HYBRIDHASH_BUILD_FIRST, node.getDriverStrategy());
    }
    catch (Exception e) {
      e.printStackTrace();
      fail(e.getClass().getSimpleName() + ": " + e.getMessage());
    }
View Full Code Here

Examples of org.apache.flink.compiler.plan.DualInputPlanNode

  }
 
  @Test
  public void testBroadcastHashSecondTest() {
    try {
      DualInputPlanNode node = createPlanAndGetJoinNode(JoinHint.BROADCAST_HASH_SECOND);
      assertEquals(ShipStrategyType.FORWARD, node.getInput1().getShipStrategy());
      assertEquals(ShipStrategyType.BROADCAST, node.getInput2().getShipStrategy());
      assertEquals(DriverStrategy.HYBRIDHASH_BUILD_SECOND, node.getDriverStrategy());
    }
    catch (Exception e) {
      e.printStackTrace();
      fail(e.getClass().getSimpleName() + ": " + e.getMessage());
    }
View Full Code Here

Examples of org.apache.flink.compiler.plan.DualInputPlanNode

      return; // silence the compiler
    }
   
    OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(oPlan);
    SinkPlanNode sinkNode = resolver.getNode("Sink");
    DualInputPlanNode coGroupNode = resolver.getNode("CoGroup");
   
    // verify the strategies
    Assert.assertEquals(ShipStrategyType.FORWARD, sinkNode.getInput().getShipStrategy());
    Assert.assertEquals(ShipStrategyType.PARTITION_HASH, coGroupNode.getInput1().getShipStrategy());
    Assert.assertEquals(ShipStrategyType.PARTITION_HASH, coGroupNode.getInput2().getShipStrategy());
   
    Channel c1 = coGroupNode.getInput1();
    Channel c2 = coGroupNode.getInput2();
   
    Assert.assertEquals(LocalStrategy.SORT, c1.getLocalStrategy());
    Assert.assertEquals(LocalStrategy.SORT, c2.getLocalStrategy());
   
    FieldList ship1 = new FieldList(new int[] {3, 0});
    FieldList ship2 = new FieldList(new int[] {6, 0});
   
    FieldList local1 = new FieldList(new int[] {3, 0, 5});
    FieldList local2 = new FieldList(new int[] {6, 0, 1, 4});
   
    Assert.assertEquals(ship1, c1.getShipStrategyKeys());
    Assert.assertEquals(ship2, c2.getShipStrategyKeys());
    Assert.assertEquals(local1, c1.getLocalStrategyKeys());
    Assert.assertEquals(local2, c2.getLocalStrategyKeys());
   
    Assert.assertTrue(c1.getLocalStrategySortOrder()[0] == coGroupNode.getSortOrders()[0]);
    Assert.assertTrue(c1.getLocalStrategySortOrder()[1] == coGroupNode.getSortOrders()[1]);
    Assert.assertTrue(c2.getLocalStrategySortOrder()[0] == coGroupNode.getSortOrders()[0]);
    Assert.assertTrue(c2.getLocalStrategySortOrder()[1] == coGroupNode.getSortOrders()[1]);
   
    // check that the local group orderings are correct
    Assert.assertTrue(c1.getLocalStrategySortOrder()[2] == groupOrder1.getFieldSortDirections()[0]);
    Assert.assertTrue(c2.getLocalStrategySortOrder()[2] == groupOrder2.getFieldSortDirections()[0]);
    Assert.assertTrue(c2.getLocalStrategySortOrder()[3] == groupOrder2.getFieldSortDirections()[1]);
View Full Code Here

Examples of org.apache.flink.compiler.plan.DualInputPlanNode

  }
 
  @Test
  public void testPartitionHashFirstTest() {
    try {
      DualInputPlanNode node = createPlanAndGetJoinNode(JoinHint.REPARTITION_HASH_FIRST);
      assertEquals(ShipStrategyType.PARTITION_HASH, node.getInput1().getShipStrategy());
      assertEquals(ShipStrategyType.PARTITION_HASH, node.getInput2().getShipStrategy());
      assertEquals(DriverStrategy.HYBRIDHASH_BUILD_FIRST, node.getDriverStrategy());
    }
    catch (Exception e) {
      e.printStackTrace();
      fail(e.getClass().getSimpleName() + ": " + e.getMessage());
    }
View Full Code Here

Examples of org.apache.flink.compiler.plan.DualInputPlanNode

  }
 
  @Test
  public void testPartitionHashSecondTest() {
    try {
      DualInputPlanNode node = createPlanAndGetJoinNode(JoinHint.REPARTITION_HASH_SECOND);
      assertEquals(ShipStrategyType.PARTITION_HASH, node.getInput1().getShipStrategy());
      assertEquals(ShipStrategyType.PARTITION_HASH, node.getInput2().getShipStrategy());
      assertEquals(DriverStrategy.HYBRIDHASH_BUILD_SECOND, node.getDriverStrategy());
    }
    catch (Exception e) {
      e.printStackTrace();
      fail(e.getClass().getSimpleName() + ": " + e.getMessage());
    }
View Full Code Here

Examples of org.apache.flink.compiler.plan.DualInputPlanNode

  }
 
  @Test
  public void testPartitionSortMergeTest() {
    try {
      DualInputPlanNode node = createPlanAndGetJoinNode(JoinHint.REPARTITION_SORT_MERGE);
      assertEquals(ShipStrategyType.PARTITION_HASH, node.getInput1().getShipStrategy());
      assertEquals(ShipStrategyType.PARTITION_HASH, node.getInput2().getShipStrategy());
      assertEquals(DriverStrategy.MERGE, node.getDriverStrategy());
    }
    catch (Exception e) {
      e.printStackTrace();
      fail(e.getClass().getSimpleName() + ": " + e.getMessage());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.