org.apache.pig.impl.plan
Class RequiredFields

java.lang.Object
  extended by org.apache.pig.impl.plan.RequiredFields

public class RequiredFields
extends Object

A struct detailing how a projection is altered by an operator.


Constructor Summary
RequiredFields(boolean needAllFields)
           
RequiredFields(boolean needAllFields, boolean needNoFields)
           
RequiredFields(List<Pair<Integer,Integer>> fields)
           
 
Method Summary
 Pair<Integer,Integer> getField(int i)
           
 List<Pair<Integer,Integer>> getFields()
           
 MapKeysInfo getMapKeysInfo(int i)
          Get the ith MapKeysInfo structure
 boolean getNeedAllFields()
           
 boolean getNeedNoFields()
           
 void merge(RequiredFields r2)
          Merge with RequiredFields r2.
 void mergeMapKey(int input, int column, String key)
          Merge another map key into existing required map keys list
 void mergeMapKeysInfo(int input, int column, MapKeysInfo mapKeysInfo)
          Merge a MapKeysInfo structure to existing required map keys list
 boolean needAllFields()
           
 boolean needNoFields()
           
 void reIndex(int i)
          Set the index of all fields to i
 void setFields(List<Pair<Integer,Integer>> fields)
           
 void setMapKeysInfo(int input, int column, MapKeysInfo mapKeysInfo)
          Set a MapKeysInfo structure to the required map keys list
 void setMapKeysInfo(int i, MapKeysInfo mapKeysInfo)
          Set the ith MapKeysInfo structure
 void setNeedAllFields(boolean needAllFields)
           
 void setNeedNoFields(boolean needNoFields)
           
 int size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RequiredFields

public RequiredFields(boolean needAllFields)
Parameters:
needAllFields - to indicate if this required fields needs all the fields from its input

RequiredFields

public RequiredFields(boolean needAllFields,
                      boolean needNoFields)
Parameters:
needAllFields - to indicate if this required fields needs no fields from its input

RequiredFields

public RequiredFields(List<Pair<Integer,Integer>> fields)
Parameters:
fields - the list of input columns that are required
Method Detail

getFields

public List<Pair<Integer,Integer>> getFields()
Returns:
the list of input columns that are required

getField

public Pair<Integer,Integer> getField(int i)
Parameters:
i - the index of the required field
Returns:
the ith required input column

size

public int size()
Returns:
the size of required input columns

setFields

public void setFields(List<Pair<Integer,Integer>> fields)
Parameters:
fields - the list of input columns that are required

needAllFields

public boolean needAllFields()
Returns:
if this required fields needs all the fields from its input(s)

getNeedAllFields

public boolean getNeedAllFields()
Returns:
if this required fields needs all the fields from its input(s)

setNeedAllFields

public void setNeedAllFields(boolean needAllFields)
Parameters:
needAllFields - to indicate if this required fields needs all the fields from its input; cannot be true if needNoFields() is true

needNoFields

public boolean needNoFields()
Returns:
if this required fields needs no fields from its input(s)

getNeedNoFields

public boolean getNeedNoFields()
Returns:
if this required fields needs no fields from its input(s)

setNeedNoFields

public void setNeedNoFields(boolean needNoFields)
Parameters:
needNoFields - to indicate if this required fields needs no fields from its input; cannot be true if needAllFields() is true

toString

public String toString()
Overrides:
toString in class Object

merge

public void merge(RequiredFields r2)
Merge with RequiredFields r2. Merge both required fields and required map keys

Parameters:
r2 - Required fields to merge

reIndex

public void reIndex(int i)
Set the index of all fields to i

Parameters:
i - New index to set

mergeMapKey

public void mergeMapKey(int input,
                        int column,
                        String key)
Merge another map key into existing required map keys list

Parameters:
input - The input of the field to merge
column - The column of the field to merge
key - The key to merge

mergeMapKeysInfo

public void mergeMapKeysInfo(int input,
                             int column,
                             MapKeysInfo mapKeysInfo)
Merge a MapKeysInfo structure to existing required map keys list

Parameters:
input - The input of the field to merge
column - The column of the field to merge
mapKeysInfo - The MapKeysInfo structure to merge

setMapKeysInfo

public void setMapKeysInfo(int input,
                           int column,
                           MapKeysInfo mapKeysInfo)
Set a MapKeysInfo structure to the required map keys list

Parameters:
input - The input of the field to set
column - The column of the field to set
mapKeysInfo - The MapKeysInfo structure to set

getMapKeysInfo

public MapKeysInfo getMapKeysInfo(int i)
Get the ith MapKeysInfo structure

Parameters:
i - The index of the MapKeysInfo, the index of MapKeysInfo is synchronized with mFields

setMapKeysInfo

public void setMapKeysInfo(int i,
                           MapKeysInfo mapKeysInfo)
Set the ith MapKeysInfo structure

Parameters:
i - The index of the MapKeysInfo, the index of MapKeysInfo is synchronized with mFields
mapKeysInfo - The MapKeysInfo to set


Copyright © ${year} The Apache Software Foundation