public class PigSchema2Avro extends Object
Modifier and Type | Field and Description |
---|---|
static String |
FIELD_NAME |
static 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 String TUPLE_NAME
public static final String FIELD_NAME
public static int tupleIndex
public static org.apache.avro.Schema convert(ResourceSchema pigSchema, boolean nullable) throws IOException
IOException
protected static org.apache.avro.Schema convert(ResourceSchema.ResourceFieldSchema pigSchema, boolean nullable) throws IOException
IOException
protected static org.apache.avro.Schema convertRecord(ResourceSchema.ResourceFieldSchema[] pigFields, boolean nullable) throws IOException
IOException
public static void setTupleIndex(int index)
index
- protected static org.apache.avro.Schema convertPrimitiveType(byte pigType) throws IOException
IOException
public static org.apache.avro.Schema validateAndConvert(org.apache.avro.Schema avroSchema, ResourceSchema pigSchema) throws IOException
IOException
protected static org.apache.avro.Schema validateAndConvert(org.apache.avro.Schema avroSchema, ResourceSchema.ResourceFieldSchema pigSchema) throws IOException
IOException
protected static org.apache.avro.Schema validateAndConvertRecord(org.apache.avro.Schema avroSchema, ResourceSchema.ResourceFieldSchema[] pigFields) throws IOException
IOException
protected static boolean isCompatible(org.apache.avro.Schema avroSchema, ResourceSchema.ResourceFieldSchema pigSchema)
Copyright © 2007-2017 The Apache Software Foundation