org.apache.pig.builtin
Class STRSPLIT

java.lang.Object
  extended by org.apache.pig.EvalFunc<Tuple>
      extended by org.apache.pig.builtin.STRSPLIT

public class STRSPLIT
extends EvalFunc<Tuple>

Wrapper around Java's String.split
input tuple: first column is assumed to have a string to split;
the optional second column is assumed to have the delimiter or regex to split on;
if not provided, it's assumed to be '\s' (space)
the optional third column may provide a limit to the number of results.
If limit is not provided, 0 is assumed, as per Java's split().


Field Summary
 
Fields inherited from class org.apache.pig.EvalFunc
log, pigLogger, reporter, returnType
 
Constructor Summary
STRSPLIT()
           
 
Method Summary
 Tuple exec(Tuple input)
          Wrapper around Java's String.split
 
Methods inherited from class org.apache.pig.EvalFunc
finish, getArgToFuncMapping, getCacheFiles, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, isAsynchronous, outputSchema, progress, setPigLogger, setReporter, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

STRSPLIT

public STRSPLIT()
Method Detail

exec

public Tuple exec(Tuple input)
           throws IOException
Wrapper around Java's String.split

Specified by:
exec in class EvalFunc<Tuple>
Parameters:
input - tuple; first column is assumed to have a string to split; the optional second column is assumed to have the delimiter or regex to split on;
if not provided, it's assumed to be '\s' (space) the optional third column may provide a limit to the number of results.
If limit is not provided, 0 is assumed, as per Java's split().
Returns:
result, of type T.
Throws:
IOException


Copyright © 2012 The Apache Software Foundation