datafu.pig.bags
Class AliasBagFields

java.lang.Object
  extended by org.apache.pig.EvalFunc<T>
      extended by datafu.pig.util.SimpleEvalFunc<org.apache.pig.data.DataBag>
          extended by datafu.pig.bags.AliasBagFields

public class AliasBagFields
extends SimpleEvalFunc<org.apache.pig.data.DataBag>

Re-alias the fields inside of a bag. For example: Example:

 define AliasBagFields datafu.pig.bags.AliasBagFields('[alpha#letter,numeric#decimal]');
 
 -- input:
 -- ({(a, 1),(b, 2),(c, 3),(d, 4)})
 input = LOAD 'input' AS (B: bag {T: tuple(alpha:CHARARRAY, numeric:INT)});
 
 output = FOREACH input GENERATE AliasBagFields(B);
 
 output schema => (B: bag {T: tuple(letter:CHARARRAY, decimal:INT)});
  
 


Field Summary
 
Fields inherited from class org.apache.pig.EvalFunc
log, pigLogger, reporter, returnType
 
Constructor Summary
AliasBagFields(java.lang.String map)
           
 
Method Summary
 org.apache.pig.data.DataBag call(org.apache.pig.data.DataBag inputBag)
           
 org.apache.pig.impl.logicalLayer.schema.Schema outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)
           
 
Methods inherited from class datafu.pig.util.SimpleEvalFunc
exec, getReturnType
 
Methods inherited from class org.apache.pig.EvalFunc
finish, getArgToFuncMapping, getCacheFiles, getLogger, getPigLogger, getReporter, getSchemaName, isAsynchronous, progress, setPigLogger, setReporter, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AliasBagFields

public AliasBagFields(java.lang.String map)
Method Detail

call

public org.apache.pig.data.DataBag call(org.apache.pig.data.DataBag inputBag)
                                 throws java.io.IOException
Throws:
java.io.IOException

outputSchema

public org.apache.pig.impl.logicalLayer.schema.Schema outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)
Overrides:
outputSchema in class org.apache.pig.EvalFunc<org.apache.pig.data.DataBag>


Matthew Hayes, Sam Shah