Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Mark the following interfaces as PublicEvolving (green font means the class is already marked as PublicEvolving),  All the rest of the classes will be marked as internal.
    • o.a.f.formats.avro.AvroDeserializationSchema
    • o.a.f.formats.avro.AvroSerializationSchema
    • o.a.f.formats.avro.AvroRowDataDeserializationSchema
    • o.a.f.formats.avro.AvroRowDataSerializationSchema
    • o.a.f.formats.avro.RegistryAvroDeserializationSchema
    • o.a.f.formats.avro.RegistryAvroSerializationSchema
    • o.a.f.formats.avro.AvroFormatOptions
    • o.a.f.formats.avro.AvroWriterFactory
    • o.a.f.formats.avro.AvroWriters
  2. The following two interfaces should probably be marked as Public for now and Deprecated once we deprecate the InputFormat / OutputFormat.
    • o.a.f.formats.avro.AvroInputFormat
    • o.a.f.formats.avro.AvroOutputFormat
    Remove the PublicEvolving annotation for the following deprecated classes. It does not make sense for an API to be PublicEvolving and Deprecated at the same time.
    • o.a.f.formats.avro.AvroRowDeserializationSchema
    • o.a.f.formats.avro.AvroRowSerialziationSchema

New public classes

Code Block
languagejava
titleAvroSchemaUtils
/**
 * A user facing public util class to help converting {@link org.apache.avro.Schema Avro Schemas}
 * to Flink {@link DataType} and {@link Schema Table Schema}.
 */
@PublicEvolving
public class AvroSchemaUtils {

    /** private constructor for util class to prevent instantiation. */
    private AvroSchemaUtils() {}

    /**
     * Converts the given Avro schema string to a Flink {@link DataType}. This is useful
     * when user wants to convert a Table to a DataStream.
     *
     * @param avroSchemaString Avro schema string
     * @return the DataType converted from Avro schema string.
     * @see org.apache.flink.table.api.bridge.java.StreamTableEnvironment#toDataStream(Table, AbstractDataType)
     */
    public static DataType convertToDataType(String avroSchemaString) {
        return AvroSchemaConverter.convertToDataType(avroSchemaString);
    }

    /**
     * Converts the given Avro schema to a Flink {@link DataType}. This is useful
     * when user wants to convert a Table to a DataStream.
     *
     * @param schema Avro schema
     * @return the DataType converted from Avro schema string.
     * @see org.apache.flink.table.api.bridge.java.StreamTableEnvironment#toDataStream(Table, AbstractDataType)
     */
    public static DataType convertToDataType(org.apache.avro.Schema schema) {
        return AvroSchemaConverter.convertToDataType(schema);
    }

    /**
     * Converts the given Avro schema string to a Flink
     * {@link org.apache.flink.table.api.Schema Table Schema}.This is useful when user wants
     * to convert a DataStream into a Table.
     *
     * @param avroSchemaString Avro schema string.
     * @see org.apache.flink.table.api.bridge.java.StreamTableEnvironment#fromDataStream(DataStream, Schema)
     * @return the Table Schema converted from Avro schema string.
     */
    public static Schema convertToTableSchema(String avroSchemaString) {
        return AvroSchemaConverter.convertToTableSchema(avroSchemaString);
    }

    /**
     * Converts the given Avro schema to a Flink
     * {@link org.apache.flink.table.api.Schema Table Schema}.This is useful when user wants
     * to convert a DataStream into a Table.
     *
     * @param schema Avro schema.
     * @see org.apache.flink.table.api.bridge.java.StreamTableEnvironment#fromDataStream(DataStream, Schema)
     * @return the Table Schema converted from Avro schema string.
     */
    public static Schema convertToTableSchema(org.apache.avro.Schema schema) {
        return AvroSchemaConverter.convertToTableSchema(schema);
    }
}

...