datafu.pig.bags
Class AliasBagFields
java.lang.Object
org.apache.pig.EvalFunc<T>
datafu.pig.util.SimpleEvalFunc<org.apache.pig.data.DataBag>
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)});
Fields inherited from class org.apache.pig.EvalFunc |
log, pigLogger, reporter, returnType |
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 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 |
AliasBagFields
public AliasBagFields(java.lang.String map)
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