Esempio n. 1
0
 /**
  * @param rearrange
  * @return
  */
 private static POPreCombinerLocalRearrange getPreCombinerLR(POLocalRearrange rearrange) {
   String scope = rearrange.getOperatorKey().scope;
   POPreCombinerLocalRearrange pclr =
       new POPreCombinerLocalRearrange(
           createOperatorKey(scope), rearrange.getRequestedParallelism(), rearrange.getInputs());
   pclr.setPlans(rearrange.getPlans());
   return pclr;
 }
Esempio n. 2
0
  /**
   * create new Local rearrange by cloning existing rearrange and add plan for projecting the key
   *
   * @param rearrange
   * @return
   * @throws PlanException
   * @throws CloneNotSupportedException
   */
  private static POLocalRearrange getNewRearrange(POLocalRearrange rearrange)
      throws PlanException, CloneNotSupportedException {
    POLocalRearrange newRearrange = rearrange.clone();

    // Set the projection to be the key
    PhysicalPlan newPlan = new PhysicalPlan();
    String scope = newRearrange.getOperatorKey().scope;
    POProject proj =
        new POProject(
            new OperatorKey(scope, NodeIdGenerator.getGenerator().getNextNodeId(scope)), -1, 0);
    proj.setResultType(newRearrange.getKeyType());
    newPlan.add(proj);

    List<PhysicalPlan> plans = new ArrayList<PhysicalPlan>(1);
    plans.add(newPlan);
    newRearrange.setPlansFromCombiner(plans);

    return newRearrange;
  }