public class TypesUtils
extends java.lang.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 java.io.IOException
schema
- The schema that the tuple will conform to.java.io.IOException
public static Tuple createTuple(int size) throws java.io.IOException
java.io.IOException
public static DataBag createBag()
public static void resetTuple(Tuple tuple)
tuple
- Input tuple.public static void checkCompatible(Tuple tuple, Schema schema) throws java.io.IOException
tuple
- Input Tuple objectschema
- Table schemajava.io.IOException
public static void checkNumberColumnCompatible(Tuple tuple, Schema schema) throws java.io.IOException
tuple
- Input Tuple objectschema
- Table schemajava.io.IOException
public static void formatTuple(Tuple tuple, int ncols) throws java.io.IOException
tuple
- java.io.IOException
Copyright © 2007-2012 The Apache Software Foundation