Package org.apache.flink.formats.avro
Class AvroRowSerializationSchema
- java.lang.Object
-
- org.apache.flink.formats.avro.AvroRowSerializationSchema
-
- All Implemented Interfaces:
Serializable
,SerializationSchema<Row>
@Internal public class AvroRowSerializationSchema extends Object implements SerializationSchema<Row>
Serialization schema that serializesRow
into Avro bytes.Serializes objects that are represented in (nested) Flink rows. It supports 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
AvroRowDeserializationSchema
and schema converterAvroSchemaConverter
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.api.common.serialization.SerializationSchema
SerializationSchema.InitializationContext
-
-
Constructor Summary
Constructors Constructor Description AvroRowSerializationSchema(Class<? extends org.apache.avro.specific.SpecificRecord> recordClazz)
Creates an Avro serialization schema for the given specific record class.AvroRowSerializationSchema(String avroSchemaString)
Creates an Avro serialization schema for the given Avro schema string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
int
hashCode()
byte[]
serialize(Row row)
Serializes the incoming element to a specified type.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.api.common.serialization.SerializationSchema
open
-
-
-
-
Constructor Detail
-
AvroRowSerializationSchema
public AvroRowSerializationSchema(Class<? extends org.apache.avro.specific.SpecificRecord> recordClazz)
Creates an Avro serialization schema for the given specific record class.- Parameters:
recordClazz
- Avro record class used to serialize Flink's row to Avro's record
-
AvroRowSerializationSchema
public AvroRowSerializationSchema(String avroSchemaString)
Creates an Avro serialization schema for the given Avro schema string.- Parameters:
avroSchemaString
- Avro schema string used to serialize Flink's row to Avro's record
-
-
Method Detail
-
serialize
public byte[] serialize(Row row)
Description copied from interface:SerializationSchema
Serializes the incoming element to a specified type.- Specified by:
serialize
in interfaceSerializationSchema<Row>
- Parameters:
row
- The incoming element to be serialized- Returns:
- The serialized element.
-
-