public final class StorageUtil extends Object
PigStorage
and streaming class PigStreaming
Modifier and Type | Field and Description |
---|---|
static StreamingDelimiters |
DEFAULT_DELIMITERS |
Constructor and Description |
---|
StorageUtil() |
Modifier and Type | Method and Description |
---|---|
static Tuple |
bytesToTuple(byte[] buf,
int offset,
int length,
byte fieldDel)
Transform bytes from a byte array up to the specified length to a
Tuple |
static byte |
parseFieldDel(String delimiter)
Transform a
String into a byte representing the
field delimiter. |
static void |
putField(OutputStream out,
Object field) |
static void |
putField(OutputStream out,
Object field,
boolean includeTypeInformation) |
static void |
putField(OutputStream out,
Object field,
StreamingDelimiters delims,
boolean includeTypeInformation)
Serialize an object to an
OutputStream in the
field-delimited form. |
static Tuple |
textToTuple(org.apache.hadoop.io.Text val,
byte fieldDel)
Transform a line of
Text to a Tuple |
public static final StreamingDelimiters DEFAULT_DELIMITERS
public static byte parseFieldDel(String delimiter)
String
into a byte representing the
field delimiter.delimiter
- a string that may be in single-quoted formpublic static void putField(OutputStream out, Object field) throws IOException
IOException
public static void putField(OutputStream out, Object field, boolean includeTypeInformation) throws IOException
IOException
public static void putField(OutputStream out, Object field, StreamingDelimiters delims, boolean includeTypeInformation) throws IOException
OutputStream
in the
field-delimited form.out
- an OutputStream objectfield
- an object to be serializedIOException
- if serialization fails.public static Tuple textToTuple(org.apache.hadoop.io.Text val, byte fieldDel)
Text
to a Tuple
val
- a line of textfieldDel
- the field delimiterpublic static Tuple bytesToTuple(byte[] buf, int offset, int length, byte fieldDel)
Tuple
buf
- the byte arraylength
- number of bytes to consume from the byte arrayfieldDel
- the field delimiterCopyright © 2007-2017 The Apache Software Foundation