public final class StorageUtil
extends java.lang.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(java.lang.String delimiter)
Transform a
String into a byte representing the
field delimiter. |
static void |
putField(java.io.OutputStream out,
java.lang.Object field) |
static void |
putField(java.io.OutputStream out,
java.lang.Object field,
boolean includeTypeInformation) |
static void |
putField(java.io.OutputStream out,
java.lang.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(java.lang.String delimiter)
String
into a byte representing the
field delimiter.delimiter
- a string that may be in single-quoted formpublic static void putField(java.io.OutputStream out, java.lang.Object field) throws java.io.IOException
java.io.IOException
public static void putField(java.io.OutputStream out, java.lang.Object field, boolean includeTypeInformation) throws java.io.IOException
java.io.IOException
public static void putField(java.io.OutputStream out, java.lang.Object field, StreamingDelimiters delims, boolean includeTypeInformation) throws java.io.IOException
OutputStream
in the
field-delimited form.out
- an OutputStream objectfield
- an object to be serializedjava.io.IOException
- 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