public class TypesUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TypesUtils.TupleReader
Reading a tuple from disk with projection.
|
static class |
TypesUtils.TupleWriter
Writing a tuple to disk.
|
| Constructor and Description |
|---|
TypesUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkCompatible(Tuple tuple,
Schema schema)
Check whether the input row object is compatible with the expected schema
|
static void |
checkNumberColumnCompatible(Tuple tuple,
Schema schema)
Check whether the input row object is compatible with the expected schema
on number of Columns;
|
static DataBag |
createBag()
Create a PIG Bag object.
|
static DataBag |
createBag(Schema schema) |
static Tuple |
createTuple(int size)
create a tuple based on number of columns
|
static Tuple |
createTuple(Schema schema)
Create a tuple based on a schema
|
static void |
formatTuple(Tuple tuple,
int ncols)
Checking and formatting an input tuple to conform to the input schema.
The current implementation always create a new tuple because PIG expects Slice.next(tuple) always returning a brand new tuple. |
static void |
resetTuple(Tuple tuple)
Reset the Tuple so that all fields are NULL field.
|
public static Tuple createTuple(Schema schema) throws IOException
schema - The schema that the tuple will conform to.IOExceptionpublic static Tuple createTuple(int size) throws IOException
IOExceptionpublic static DataBag createBag()
public static void resetTuple(Tuple tuple)
tuple - Input tuple.public static void checkCompatible(Tuple tuple, Schema schema) throws IOException
tuple - Input Tuple objectschema - Table schemaIOExceptionpublic static void checkNumberColumnCompatible(Tuple tuple, Schema schema) throws IOException
tuple - Input Tuple objectschema - Table schemaIOExceptionpublic static void formatTuple(Tuple tuple, int ncols) throws IOException
tuple - IOExceptionCopyright © 2007-2012 The Apache Software Foundation