org.apache.pig.impl.util.avro
Class AvroStorageDataConversionUtilities

java.lang.Object
  extended by 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.


Constructor Summary
AvroStorageDataConversionUtilities()
           
 
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
 

Constructor Detail

AvroStorageDataConversionUtilities

public AvroStorageDataConversionUtilities()
Method Detail

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 object
s - 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 array
s - 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