@InterfaceAudience.Private public class CombinerOptimizerUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CombinerOptimizerUtil.DistinctPatcher
A visitor to replace
Project[bag][*]
|
|---PODistinct[bag]
with
POUserFunc(org.apache.pig.builtin.Distinct)[DataBag]
|
static class |
CombinerOptimizerUtil.fixMapProjects |
Modifier and Type | Method and Description |
---|---|
static void |
addAlgebraicFuncToCombineFE(POForEach cfe,
Map<PhysicalOperator,Integer> op2newpos)
add algebraic functions with appropriate projection to new foreach in combiner
|
static void |
addCombiner(PhysicalPlan mapPlan,
PhysicalPlan reducePlan,
PhysicalPlan combinePlan,
CompilationMessageCollector messageCollector,
boolean doMapAgg)
Algebraic functions and distinct in nested plan of a foreach are
partially computed in the map and combine phase.
|
static void |
changeFunc(POForEach fe,
byte type)
Change the algebriac function type for algebraic functions in map and combine
In map and combine the algebraic functions will be leaf of the plan
|
static POForEach |
createForEachWithGrpProj(POForEach foreach,
byte keyType)
Create a new foreach with same scope,alias as given foreach
add an inner plan that projects the group column, which is going to be
the first input
|
static OperatorKey |
createOperatorKey(String scope) |
static PhysicalPlan |
createPlanWithPredecessors(PhysicalOperator algeOp,
PhysicalPlan pplan)
Create new plan and add to it the clones of operator algeOp and its
predecessors from the physical plan pplan .
|
static List<Pair<PhysicalOperator,PhysicalPlan>> |
findAlgebraicOps(List<PhysicalPlan> feInners)
find algebraic operators and also check if the foreach statement is
suitable for combiner use
|
static POLocalRearrange |
getNewRearrange(POLocalRearrange rearrange)
create new Local rearrange by cloning existing rearrange and
add plan for projecting the key
|
static POPreCombinerLocalRearrange |
getPreCombinerLR(POLocalRearrange rearrange) |
public static void addCombiner(PhysicalPlan mapPlan, PhysicalPlan reducePlan, PhysicalPlan combinePlan, CompilationMessageCollector messageCollector, boolean doMapAgg) throws VisitorException
VisitorException
public static List<Pair<PhysicalOperator,PhysicalPlan>> findAlgebraicOps(List<PhysicalPlan> feInners) throws VisitorException
feInners
- inner plans of foreachVisitorException
public static POForEach createForEachWithGrpProj(POForEach foreach, byte keyType)
foreach
- source foreachkeyType
- type for group-by keypublic static PhysicalPlan createPlanWithPredecessors(PhysicalOperator algeOp, PhysicalPlan pplan) throws CloneNotSupportedException, PlanException
algeOp
- algebraic operatorpplan
- physical plan that has algeOpCloneNotSupportedException
PlanException
public static void addAlgebraicFuncToCombineFE(POForEach cfe, Map<PhysicalOperator,Integer> op2newpos) throws CloneNotSupportedException, PlanException
cfe
- - the new foreach in combinerop2newpos
- - mapping of physical operator to position in inputCloneNotSupportedException
PlanException
public static POPreCombinerLocalRearrange getPreCombinerLR(POLocalRearrange rearrange)
rearrange
- public static OperatorKey createOperatorKey(String scope)
public static void changeFunc(POForEach fe, byte type) throws PlanException
fe
- type
- PlanException
public static POLocalRearrange getNewRearrange(POLocalRearrange rearrange) throws PlanException, CloneNotSupportedException
rearrange
- PlanException
CloneNotSupportedException
Copyright © 2007-2017 The Apache Software Foundation