|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.pig.impl.util.avro.AvroTupleWrapper<T>
T - The type of the Avro objectpublic final class AvroTupleWrapper<T extends org.apache.avro.generic.IndexedRecord>
Object that wraps an Avro object in a tuple.
| Field Summary |
|---|
| Fields inherited from interface org.apache.pig.data.Tuple |
|---|
NOTNULL, NULL |
| Constructor Summary | |
|---|---|
AvroTupleWrapper(T o)
Creates a new AvroTupleWrapper object. |
|
| Method Summary | |
|---|---|
void |
append(Object o)
Append a field to a tuple. |
int |
compareTo(Object o)
|
Object |
get(int pos)
Get the value in a given field. |
List<Object> |
getAll()
Get all of the fields in the tuple as a list. |
long |
getMemorySize()
Determine the size of tuple in memory. |
byte |
getType(int arg0)
Find the type of a given field. |
boolean |
isNull(int arg0)
Find out if a given field is null. |
Iterator<Object> |
iterator()
|
void |
readFields(DataInput d)
|
void |
reference(Tuple arg0)
Make this tuple reference the contents of another. |
void |
set(int arg0,
Object arg1)
Set the value in a given field. |
int |
size()
Find the size of the tuple. |
String |
toDelimitedString(String arg0)
Write a tuple of values into a string. |
static Object |
unionResolver(Object o)
|
void |
write(DataOutput o)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AvroTupleWrapper(T o)
o - The object to wrap| Method Detail |
|---|
public void write(DataOutput o)
throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic int compareTo(Object o)
compareTo in interface Comparablepublic void append(Object o)
TupleTupleFactory.newTuple(int) and then fill in the values with
Tuple.set(int, Object), rather
than construct it with TupleFactory.newTuple() and append values.
append in interface Tupleo - Object to append to the tuple.
public Object get(int pos)
throws ExecException
Tuple
get in interface Tuplepos - Number of the field to get the value for.
ExecException - if the field number is greater than or equal to
the number of fields in the tuple.public static Object unionResolver(Object o)
public List<Object> getAll()
Tuple
getAll in interface Tuplepublic long getMemorySize()
Tuple
getMemorySize in interface Tuple
public byte getType(int arg0)
throws ExecException
Tuple
getType in interface Tuplearg0 - Number of field to get the type for.
DataType. If the field is null, then DataType.UNKNOWN
will be returned.
ExecException - if the field number is greater than or equal to
the number of fields in the tuple.
public boolean isNull(int arg0)
throws ExecException
Tuple
isNull in interface Tuplearg0 - Number of field to check for null.
ExecException - if the field number given is greater
than or equal to the number of fields in the tuple.public void reference(Tuple arg0)
Tuple
reference in interface Tuplearg0 - Tuple to reference.
public void set(int arg0,
Object arg1)
throws ExecException
TupleTupleFactory.newTuple(int) with an
argument greater than the fieldNum being passed here. This call will
not automatically expand the tuple size. That is if you called
TupleFactory.newTuple(int) with a 2, it is okay to call
this function with a 1, but not with a 2 or greater.
set in interface Tuplearg0 - Number of the field to set the value for.arg1 - Object to put in the indicated field.
ExecException - if the field number is greater than or equal to
the number of fields in the tuple.public int size()
Tuple
size in interface Tuple
public String toDelimitedString(String arg0)
throws ExecException
Tuple
toDelimitedString in interface Tuplearg0 - Delimiter to use in the string.
ExecException - this is never thrown. This only exists for backwards compatability reasons.
public void readFields(DataInput d)
throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionpublic Iterator<Object> iterator()
iterator in interface Iterable<Object>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||