public class PigSchema2Avro
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FIELD_NAME |
static java.lang.String |
TUPLE_NAME |
static int |
tupleIndex |
Constructor and Description |
---|
PigSchema2Avro() |
Modifier and Type | Method and Description |
---|---|
protected static org.apache.avro.Schema |
convert(ResourceSchema.ResourceFieldSchema pigSchema,
boolean nullable)
Convert a Pig ResourceFieldSchema to avro schema
|
static org.apache.avro.Schema |
convert(ResourceSchema pigSchema,
boolean nullable)
Convert a pig ResourceSchema to avro schema
|
protected static org.apache.avro.Schema |
convertPrimitiveType(byte pigType)
Convert Pig primitive type to Avro type
|
protected static org.apache.avro.Schema |
convertRecord(ResourceSchema.ResourceFieldSchema[] pigFields,
boolean nullable)
Convert pig data to Avro record
|
protected static boolean |
isCompatible(org.apache.avro.Schema avroSchema,
ResourceSchema.ResourceFieldSchema pigSchema)
Check whether Avro type is compatible with Pig type
|
static void |
setTupleIndex(int index)
This is a painful hack to make unit tests pass.
|
protected static org.apache.avro.Schema |
validateAndConvert(org.apache.avro.Schema avroSchema,
ResourceSchema.ResourceFieldSchema pigSchema)
Validate whether pigSchema is compatible with avroSchema and convert
those Pig fields with to corresponding Avro schemas.
|
static org.apache.avro.Schema |
validateAndConvert(org.apache.avro.Schema avroSchema,
ResourceSchema pigSchema)
Validate whether pigSchema is compatible with avroSchema
|
protected static org.apache.avro.Schema |
validateAndConvertRecord(org.apache.avro.Schema avroSchema,
ResourceSchema.ResourceFieldSchema[] pigFields)
Validate a Pig tuple is compatible with Avro record.
|
public static final java.lang.String TUPLE_NAME
public static final java.lang.String FIELD_NAME
public static int tupleIndex
public static org.apache.avro.Schema convert(ResourceSchema pigSchema, boolean nullable) throws java.io.IOException
java.io.IOException
protected static org.apache.avro.Schema convert(ResourceSchema.ResourceFieldSchema pigSchema, boolean nullable) throws java.io.IOException
java.io.IOException
protected static org.apache.avro.Schema convertRecord(ResourceSchema.ResourceFieldSchema[] pigFields, boolean nullable) throws java.io.IOException
java.io.IOException
public static void setTupleIndex(int index)
index
- protected static org.apache.avro.Schema convertPrimitiveType(byte pigType) throws java.io.IOException
java.io.IOException
public static org.apache.avro.Schema validateAndConvert(org.apache.avro.Schema avroSchema, ResourceSchema pigSchema) throws java.io.IOException
java.io.IOException
protected static org.apache.avro.Schema validateAndConvert(org.apache.avro.Schema avroSchema, ResourceSchema.ResourceFieldSchema pigSchema) throws java.io.IOException
java.io.IOException
protected static org.apache.avro.Schema validateAndConvertRecord(org.apache.avro.Schema avroSchema, ResourceSchema.ResourceFieldSchema[] pigFields) throws java.io.IOException
java.io.IOException
protected static boolean isCompatible(org.apache.avro.Schema avroSchema, ResourceSchema.ResourceFieldSchema pigSchema)
Copyright © 2007-2012 The Apache Software Foundation