public class Coalesce extends AliasableEvalFunc<java.lang.Object>
define COALESCE datafu.pig.util.COALESCE();
-- input: 1,2,3,NULL,4,NULL,5
input = LOAD 'input' AS (val:int);
-- produces: 1,2,3,99,4,99,5
coalesced = FOREACH input GENERATE COALESCE(val,99);
| Constructor and Description |
|---|
Coalesce() |
Coalesce(java.lang.String option) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
exec(org.apache.pig.data.Tuple input) |
org.apache.pig.impl.logicalLayer.schema.Schema |
getOutputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)
Specify the output schema as in {link EvalFunc#outputSchema(Schema)}.
|
getBag, getBoolean, getDouble, getDouble, getFieldAliases, getFloat, getFloat, getInteger, getInteger, getLong, getLong, getObject, getPosition, getPosition, getPrefixedAliasName, getString, getString, outputSchemagetContextProperties, getInstanceName, getInstanceProperties, onReady, setUDFContextSignatureallowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, progress, setInputSchema, setPigLogger, setReporter, warnpublic java.lang.Object exec(org.apache.pig.data.Tuple input)
throws java.io.IOException
exec in class org.apache.pig.EvalFunc<java.lang.Object>java.io.IOExceptionpublic org.apache.pig.impl.logicalLayer.schema.Schema getOutputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)
AliasableEvalFuncgetOutputSchema in class AliasableEvalFunc<java.lang.Object>input - input schema