Package org.apache.flink.compiler.plan

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


      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

  }
 
  @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

  }
 
  @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

  }
 
  @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

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

TOP

Related Classes of org.apache.flink.compiler.plan.DualInputPlanNode

Copyright © 2018 www.massapicom. 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.