@PublicEvolving public class AvroRowDataDeserializationSchema extends Object implements org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData>
RowData.
Deserializes the byte[] messages into (nested) Flink RowData. It converts Avro
types into types that are compatible with Flink's Table & SQL API.
Projects with Avro records containing logical date/time types need to add a JodaTime dependency.
Note: Changes in this class need to be kept in sync with the corresponding runtime class
AvroRowDataSerializationSchema and schema converter AvroSchemaConverter.
| Constructor and Description |
|---|
AvroRowDataDeserializationSchema(org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.avro.generic.GenericRecord> nestedSchema,
AvroToRowDataConverters.AvroToRowDataConverter runtimeConverter,
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> typeInfo)
Creates a Avro deserialization schema for the given logical type.
|
AvroRowDataDeserializationSchema(org.apache.flink.table.types.logical.RowType rowType,
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> typeInfo)
Creates an Avro deserialization schema for the given logical type.
|
AvroRowDataDeserializationSchema(org.apache.flink.table.types.logical.RowType rowType,
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> typeInfo,
AvroFormatOptions.AvroEncoding encoding)
Creates an Avro deserialization schema for the given logical type.
|
AvroRowDataDeserializationSchema(org.apache.flink.table.types.logical.RowType rowType,
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> typeInfo,
AvroFormatOptions.AvroEncoding encoding,
boolean legacyTimestampMapping)
Creates an Avro deserialization schema for the given logical type.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.flink.table.data.RowData |
deserialize(byte[] message) |
boolean |
equals(Object o) |
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> |
getProducedType() |
int |
hashCode() |
boolean |
isEndOfStream(org.apache.flink.table.data.RowData nextElement) |
void |
open(org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext context) |
public AvroRowDataDeserializationSchema(org.apache.flink.table.types.logical.RowType rowType,
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> typeInfo)
rowType - The logical type used to deserialize the data.typeInfo - The TypeInformation to be used by getProducedType().public AvroRowDataDeserializationSchema(org.apache.flink.table.types.logical.RowType rowType,
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> typeInfo,
AvroFormatOptions.AvroEncoding encoding)
rowType - The logical type used to deserialize the data.typeInfo - The TypeInformation to be used by getProducedType().encoding - The serialization approach used to deserialize the data.public AvroRowDataDeserializationSchema(org.apache.flink.table.types.logical.RowType rowType,
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> typeInfo,
AvroFormatOptions.AvroEncoding encoding,
boolean legacyTimestampMapping)
rowType - The logical type used to deserialize the data.typeInfo - The TypeInformation to be used by getProducedType().encoding - The serialization approach used to deserialize the data.legacyTimestampMapping - Whether to use legacy timestamp mapping.public AvroRowDataDeserializationSchema(org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.avro.generic.GenericRecord> nestedSchema,
AvroToRowDataConverters.AvroToRowDataConverter runtimeConverter,
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> typeInfo)
nestedSchema - Deserialization schema to deserialize as GenericRecordruntimeConverter - Converter that transforms a GenericRecord into RowDatatypeInfo - The TypeInformation to be used by getProducedType()public void open(org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext context)
throws Exception
open in interface org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData>Exceptionpublic org.apache.flink.table.data.RowData deserialize(@Nullable byte[] message) throws IOException
deserialize in interface org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData>IOExceptionpublic boolean isEndOfStream(org.apache.flink.table.data.RowData nextElement)
isEndOfStream in interface org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData>public org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> getProducedType()
getProducedType in interface org.apache.flink.api.java.typeutils.ResultTypeQueryable<org.apache.flink.table.data.RowData>Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.