Class MapKeysPruneHelper

  extended by org.apache.pig.newplan.logical.rules.MapKeysPruneHelper

public class MapKeysPruneHelper
extends Object

This filter Marks every Load Operator which has a Map with MAP_MARKER_ANNOTATION. The annotation value is Map> where Integer is the column number of the field and Set is the set of Keys in this field ( field is a map field only ). It does this for only the top level schema in load. Algorithm: Traverse the Plan in ReverseDependency order ( ie. Sink to Source ) For LogicalRelationalOperators having MapLookupExpression in their expressionPlan collect uid and keys related to it. This is retained in the visitor For ForEach having nested LogicalPlan use the same visitor hence there is no distinction required At Sources find all the uids provided by this source and annotate this LogicalRelationalOperator ( load ) with Map> containing only the column numbers that this LogicalRelationalOperator generates NOTE: This is a simple Map Pruner. If a map key is mentioned in the script then this pruner assumes you need the key. This pruner is not as optimized as column pruner ( which removes a column if it is mentioned but never used )

Nested Class Summary
static class MapKeysPruneHelper.FullMapCollector
static class MapKeysPruneHelper.MapMarker
          This class collects all the information required to create the list of keys required for a map
Field Summary
Constructor Summary
MapKeysPruneHelper(OperatorPlan currentPlan)
Method Summary
 boolean check()
 OperatorPlan reportChanges()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public static final String REQUIRED_MAPKEYS
See Also:
Constant Field Values
Constructor Detail


public MapKeysPruneHelper(OperatorPlan currentPlan)
Method Detail


public boolean check()
              throws FrontendException


public OperatorPlan reportChanges()

Copyright © 2007-2012 The Apache Software Foundation