public class AvroStorageSchemaConversionUtilities
extends java.lang.Object
Constructor and Description |
---|
AvroStorageSchemaConversionUtilities() |
Modifier and Type | Method and Description |
---|---|
static ResourceSchema |
avroSchemaToResourceSchema(org.apache.avro.Schema s,
java.lang.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,
java.util.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,
java.lang.String recordName,
java.lang.String recordNameSpace,
java.util.Map<java.lang.String,java.util.List<org.apache.avro.Schema>> definedRecordNames,
java.lang.Boolean doubleColonsToDoubleUnderscores)
Translated a ResourceSchema to an Avro Schema.
|
public AvroStorageSchemaConversionUtilities()
public static byte getPigType(org.apache.avro.Schema s) throws ExecException
s
- The avro schema for which to determine the typeExecException
Schema.Type
public static boolean isUnionOfSimpleTypes(org.apache.avro.Schema s)
public static ResourceSchema avroSchemaToResourceSchema(org.apache.avro.Schema s, java.lang.Boolean allowRecursiveSchema) throws java.io.IOException
s
- The avro schema for which to determine the typeallowRecursiveSchema
- Flag indicating whether to
throw an error if a recursive schema definition is foundjava.io.IOException
public static org.apache.avro.Schema resourceSchemaToAvroSchema(ResourceSchema rs, java.lang.String recordName, java.lang.String recordNameSpace, java.util.Map<java.lang.String,java.util.List<org.apache.avro.Schema>> definedRecordNames, java.lang.Boolean doubleColonsToDoubleUnderscores) throws java.io.IOException
rs
- Input schema.recordName
- Record namerecordNameSpace
- NamespacedefinedRecordNames
- Map of already defined record names
to schema objectsjava.io.IOException
public static boolean isNullableUnion(org.apache.avro.Schema s)
s
- The object to checkpublic static org.apache.avro.Schema removeSimpleUnion(org.apache.avro.Schema s)
s
- The input schema objectpublic 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 listpublic static org.apache.avro.Schema newSchemaFromRequiredFieldList(org.apache.avro.Schema oldSchema, java.util.List<LoadPushDown.RequiredField> rfl)
oldSchema
- The avro schema from which to extract the schemarfl
- List of required fieldsCopyright © 2007-2012 The Apache Software Foundation