Class AvroSchemaConverter

java.lang.Object
org.apache.parquet.avro.AvroSchemaConverter

public class AvroSchemaConverter extends Object

Converts an Avro schema into a Parquet schema, or vice versa. See package documentation for details of the mapping.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    AvroSchemaConverter(org.apache.hadoop.conf.Configuration conf)
     
    AvroSchemaConverter(org.apache.parquet.conf.ParquetConfiguration conf)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.parquet.schema.MessageType
    convert(org.apache.avro.Schema avroSchema)
     
    org.apache.avro.Schema
    convert(org.apache.parquet.schema.MessageType parquetSchema)
     
    static org.apache.avro.Schema
    getNonNull(org.apache.avro.Schema schema)
    Given a schema, check to see if it is a union of a null type and a regular schema, and then return the non-null sub-schema.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • AvroSchemaConverter

      public AvroSchemaConverter()
    • AvroSchemaConverter

      public AvroSchemaConverter(org.apache.hadoop.conf.Configuration conf)
    • AvroSchemaConverter

      public AvroSchemaConverter(org.apache.parquet.conf.ParquetConfiguration conf)
  • Method Details

    • getNonNull

      public static org.apache.avro.Schema getNonNull(org.apache.avro.Schema schema)
      Given a schema, check to see if it is a union of a null type and a regular schema, and then return the non-null sub-schema. Otherwise, return the given schema.
      Parameters:
      schema - The schema to check
      Returns:
      The non-null portion of a union schema, or the given schema
    • convert

      public org.apache.parquet.schema.MessageType convert(org.apache.avro.Schema avroSchema)
    • convert

      public org.apache.avro.Schema convert(org.apache.parquet.schema.MessageType parquetSchema)