Package org.apache.flink.formats.avro
Class AvroRowDataSerializationSchema
- java.lang.Object
-
- org.apache.flink.formats.avro.AvroRowDataSerializationSchema
-
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.serialization.SerializationSchema<org.apache.flink.table.data.RowData>
public class AvroRowDataSerializationSchema extends Object implements org.apache.flink.api.common.serialization.SerializationSchema<org.apache.flink.table.data.RowData>
Serialization schema that serializesRowDatainto Avro bytes.Serializes objects that are represented in (nested) Flink RowData. It support types that are compatible with Flink's Table & SQL API.
Note: Changes in this class need to be kept in sync with the corresponding runtime class
AvroRowDataDeserializationSchemaand schema converterAvroSchemaConverter.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AvroRowDataSerializationSchema(org.apache.flink.table.types.logical.RowType rowType)Creates an Avro serialization schema with the given record row type.AvroRowDataSerializationSchema(org.apache.flink.table.types.logical.RowType rowType, org.apache.flink.api.common.serialization.SerializationSchema<org.apache.avro.generic.GenericRecord> nestedSchema, RowDataToAvroConverters.RowDataToAvroConverter runtimeConverter)Creates an Avro serialization schema with the given record row type, nested schema and runtime converters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()voidopen(org.apache.flink.api.common.serialization.SerializationSchema.InitializationContext context)byte[]serialize(org.apache.flink.table.data.RowData row)
-
-
-
Constructor Detail
-
AvroRowDataSerializationSchema
public AvroRowDataSerializationSchema(org.apache.flink.table.types.logical.RowType rowType)
Creates an Avro serialization schema with the given record row type.
-
AvroRowDataSerializationSchema
public AvroRowDataSerializationSchema(org.apache.flink.table.types.logical.RowType rowType, org.apache.flink.api.common.serialization.SerializationSchema<org.apache.avro.generic.GenericRecord> nestedSchema, RowDataToAvroConverters.RowDataToAvroConverter runtimeConverter)Creates an Avro serialization schema with the given record row type, nested schema and runtime converters.
-
-
Method Detail
-
open
public void open(org.apache.flink.api.common.serialization.SerializationSchema.InitializationContext context) throws Exception- Specified by:
openin interfaceorg.apache.flink.api.common.serialization.SerializationSchema<org.apache.flink.table.data.RowData>- Throws:
Exception
-
serialize
public byte[] serialize(org.apache.flink.table.data.RowData row)
- Specified by:
serializein interfaceorg.apache.flink.api.common.serialization.SerializationSchema<org.apache.flink.table.data.RowData>
-
-