org.apache.pig.impl.util.avro
Class AvroStorageDataConversionUtilities
java.lang.Object
org.apache.pig.impl.util.avro.AvroStorageDataConversionUtilities
public class AvroStorageDataConversionUtilities
- extends Object
Utility classes for AvroStorage; contains static methods
for converting between Avro and Pig objects.
Method Summary |
static org.apache.avro.generic.GenericData.Array<Object> |
packIntoAvro(DataBag db,
org.apache.avro.Schema s)
Packs a Pig DataBag into an Avro array. |
static org.apache.avro.generic.GenericData.Record |
packIntoAvro(Tuple t,
org.apache.avro.Schema s)
Packs a Pig Tuple into an Avro record. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AvroStorageDataConversionUtilities
public AvroStorageDataConversionUtilities()
packIntoAvro
public static org.apache.avro.generic.GenericData.Record packIntoAvro(Tuple t,
org.apache.avro.Schema s)
throws IOException
- Packs a Pig Tuple into an Avro record.
- Parameters:
t
- the Pig tuple to pack into the avro objects
- The avro schema for which to determine the type
- Returns:
- the avro record corresponding to the input tuple
- Throws:
IOException
packIntoAvro
public static org.apache.avro.generic.GenericData.Array<Object> packIntoAvro(DataBag db,
org.apache.avro.Schema s)
throws IOException
- Packs a Pig DataBag into an Avro array.
- Parameters:
db
- the Pig databad to pack into the avro arrays
- The avro schema for which to determine the type
- Returns:
- the avro array corresponding to the input bag
- Throws:
IOException
Copyright © 2007-2012 The Apache Software Foundation