コード例 #1
0
 private void testQueryGeneric(
     long orderSize,
     long lineItemSize,
     float ordersFilterFactor,
     float joinFilterFactor,
     boolean broadcastOkay,
     boolean partitionedOkay,
     boolean hashJoinFirstOkay,
     boolean hashJoinSecondOkay,
     boolean mergeJoinOkay) {
   TPCHQuery3 query = new TPCHQuery3();
   Plan p = query.getPlan(DEFAULT_PARALLELISM_STRING, IN_FILE, IN_FILE, OUT_FILE);
   p.setExecutionConfig(defaultExecutionConfig);
   testQueryGeneric(
       p,
       orderSize,
       lineItemSize,
       ordersFilterFactor,
       joinFilterFactor,
       broadcastOkay,
       partitionedOkay,
       hashJoinFirstOkay,
       hashJoinSecondOkay,
       mergeJoinOkay);
 }
コード例 #2
0
  /**
   * Verifies that a robust repartitioning plan with a hash join is created in the absence of
   * statistics.
   */
  @Test
  public void testQueryNoStatistics() {
    try {
      TPCHQuery3 query = new TPCHQuery3();
      Plan p = query.getPlan(DEFAULT_PARALLELISM_STRING, IN_FILE, IN_FILE, OUT_FILE);
      p.setExecutionConfig(defaultExecutionConfig);
      // compile
      final OptimizedPlan plan = compileNoStats(p);

      final OptimizerPlanNodeResolver or = getOptimizerPlanNodeResolver(plan);

      // get the nodes from the final plan
      final SinkPlanNode sink = or.getNode("Output");
      final SingleInputPlanNode reducer = or.getNode("AggLio");
      final SingleInputPlanNode combiner =
          reducer.getPredecessor() instanceof SingleInputPlanNode
              ? (SingleInputPlanNode) reducer.getPredecessor()
              : null;
      final DualInputPlanNode join = or.getNode("JoinLiO");
      final SingleInputPlanNode filteringMapper = or.getNode("FilterO");

      // verify the optimizer choices
      checkStandardStrategies(filteringMapper, join, combiner, reducer, sink);
      Assert.assertTrue(checkRepartitionShipStrategies(join, reducer, combiner));
      Assert.assertTrue(
          checkHashJoinStrategies(join, reducer, true)
              || checkHashJoinStrategies(join, reducer, false));
    } catch (Exception e) {
      e.printStackTrace();
      Assert.fail(e.getMessage());
    }
  }
コード例 #3
0
  /**
   * Statistics that push towards a repartition merge join. If the join blows the data volume up
   * significantly, re-exploiting the sorted order is cheaper.
   */
  @Test
  public void testQueryWithStatsForRepartitionMerge() {
    TPCHQuery3 query = new TPCHQuery3();
    Plan p = query.getPlan(DEFAULT_PARALLELISM_STRING, IN_FILE, IN_FILE, OUT_FILE);
    p.setExecutionConfig(defaultExecutionConfig);
    // set compiler hints
    OperatorResolver cr = getContractResolver(p);
    JoinOperator match = cr.getNode("JoinLiO");
    match.getCompilerHints().setFilterFactor(100f);

    testQueryGeneric(
        100l * 1024 * 1024 * 1024 * 1024,
        100l * 1024 * 1024 * 1024 * 1024,
        0.05f,
        100f,
        false,
        true,
        false,
        false,
        true);
  }