|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.pig.impl.util.avro.AvroStorageSchemaConversionUtilities
public class AvroStorageSchemaConversionUtilities
Static methods for converting from Avro Schema object to Pig Schema objects, and vice versa.
| Constructor Summary | |
|---|---|
AvroStorageSchemaConversionUtilities()
|
|
| Method Summary | |
|---|---|
static ResourceSchema |
avroSchemaToResourceSchema(org.apache.avro.Schema s,
Boolean allowRecursiveSchema)
Translates an Avro schema to a Resource Schema (for Pig). |
static byte |
getPigType(org.apache.avro.Schema s)
Determines the pig object type of the Avro schema. |
static boolean |
isNullableUnion(org.apache.avro.Schema s)
Checks to see if an avro schema is a combination of null and another object. |
static boolean |
isUnionOfSimpleTypes(org.apache.avro.Schema s)
|
static org.apache.avro.Schema |
newSchemaFromRequiredFieldList(org.apache.avro.Schema oldSchema,
List<LoadPushDown.RequiredField> rfl)
Takes an Avro Schema and a Pig RequiredFieldList and returns a new schema with only the required fields, or no if the function can't extract only those fields. |
static org.apache.avro.Schema |
newSchemaFromRequiredFieldList(org.apache.avro.Schema oldSchema,
LoadPushDown.RequiredFieldList rfl)
Takes an Avro Schema and a Pig RequiredFieldList and returns a new schema with only the requried fields, or no if the function can't extract only those fields. |
static org.apache.avro.Schema |
removeSimpleUnion(org.apache.avro.Schema s)
Given an input schema that is a union of an avro schema and null (or just a union with one type), return the avro schema. |
static org.apache.avro.Schema |
resourceSchemaToAvroSchema(ResourceSchema rs,
String recordName,
String recordNameSpace,
Map<String,List<org.apache.avro.Schema>> definedRecordNames,
Boolean doubleColonsToDoubleUnderscores)
Translated a ResourceSchema to an Avro Schema. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AvroStorageSchemaConversionUtilities()
| Method Detail |
|---|
public static byte getPigType(org.apache.avro.Schema s)
throws ExecException
s - The avro schema for which to determine the type
ExecExceptionSchema.Typepublic static boolean isUnionOfSimpleTypes(org.apache.avro.Schema s)
public static ResourceSchema avroSchemaToResourceSchema(org.apache.avro.Schema s,
Boolean allowRecursiveSchema)
throws IOException
s - The avro schema for which to determine the typeallowRecursiveSchema - Flag indicating whether to
throw an error if a recursive schema definition is found
IOException
public static org.apache.avro.Schema resourceSchemaToAvroSchema(ResourceSchema rs,
String recordName,
String recordNameSpace,
Map<String,List<org.apache.avro.Schema>> definedRecordNames,
Boolean doubleColonsToDoubleUnderscores)
throws IOException
rs - Input schema.recordName - Record namerecordNameSpace - NamespacedefinedRecordNames - Map of already defined record names
to schema objects
IOExceptionpublic static boolean isNullableUnion(org.apache.avro.Schema s)
s - The object to check
public static org.apache.avro.Schema removeSimpleUnion(org.apache.avro.Schema s)
s - The input schema object
public static org.apache.avro.Schema newSchemaFromRequiredFieldList(org.apache.avro.Schema oldSchema,
LoadPushDown.RequiredFieldList rfl)
oldSchema - The avro schema from which to extract the schemarfl - the Pig required field list
public static org.apache.avro.Schema newSchemaFromRequiredFieldList(org.apache.avro.Schema oldSchema,
List<LoadPushDown.RequiredField> rfl)
oldSchema - The avro schema from which to extract the schemarfl - List of required fields
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||