Class SchemaConverters

Object
org.apache.spark.sql.avro.SchemaConverters

public class SchemaConverters extends Object
This object contains method that are used to convert sparkSQL schemas to avro schemas and vice versa.
  • Constructor Details

    • SchemaConverters

      public SchemaConverters()
  • Method Details

    • toSqlType

      public static SchemaConverters.SchemaType toSqlType(org.apache.avro.Schema avroSchema, boolean useStableIdForUnionType, String stableIdPrefixForUnionType)
      Converts an Avro schema to a corresponding Spark SQL schema.

      Parameters:
      avroSchema - (undocumented)
      useStableIdForUnionType - (undocumented)
      stableIdPrefixForUnionType - (undocumented)
      Returns:
      (undocumented)
      Since:
      4.0.0
    • toSqlType

      public static SchemaConverters.SchemaType toSqlType(org.apache.avro.Schema avroSchema)
      Converts an Avro schema to a corresponding Spark SQL schema.

      Parameters:
      avroSchema - (undocumented)
      Returns:
      (undocumented)
      Since:
      2.4.0
    • toSqlType

      public static SchemaConverters.SchemaType toSqlType(org.apache.avro.Schema avroSchema, scala.collection.immutable.Map<String,String> options)
      Deprecated.
      using toSqlType(..., useStableIdForUnionType: Boolean) instead. Since 4.0.0.
    • toAvroType

      public static org.apache.avro.Schema toAvroType(DataType catalystType, boolean nullable, String recordName, String nameSpace)
      Converts a Spark SQL schema to a corresponding Avro schema.

      Parameters:
      catalystType - (undocumented)
      nullable - (undocumented)
      recordName - (undocumented)
      nameSpace - (undocumented)
      Returns:
      (undocumented)
      Since:
      2.4.0