Class AvroTypeInfo<T extends org.apache.avro.specific.SpecificRecordBase>
java.lang.Object
org.apache.flink.api.common.typeinfo.TypeInformation<T>
org.apache.flink.api.common.typeutils.CompositeType<T>
org.apache.flink.api.java.typeutils.PojoTypeInfo<T>
org.apache.flink.formats.avro.typeutils.AvroTypeInfo<T>
- All Implemented Interfaces:
Serializable
public class AvroTypeInfo<T extends org.apache.avro.specific.SpecificRecordBase>
extends org.apache.flink.api.java.typeutils.PojoTypeInfo<T>
Special type information to generate a special AvroTypeInfo for Avro POJOs (implementing
SpecificRecordBase, the typed Avro POJOs)
Proceeding: It uses a regular pojo type analysis and replaces all
GenericType<CharSequence> with a GenericType<avro.Utf8>. All other types used by Avro
are standard Java types. Only strings are represented as CharSequence fields and represented as
Utf8 classes at runtime. CharSequence is not comparable. To make them nicely usable with field
expressions, we replace them here by generic type infos containing Utf8 classes (which are
comparable),
This class is checked by the AvroPojoTest.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.flink.api.java.typeutils.PojoTypeInfo
org.apache.flink.api.java.typeutils.PojoTypeInfo.NamedFlatFieldDescriptorNested classes/interfaces inherited from class org.apache.flink.api.common.typeutils.CompositeType
org.apache.flink.api.common.typeutils.CompositeType.FlatFieldDescriptor, org.apache.flink.api.common.typeutils.CompositeType.InvalidFieldReferenceException, org.apache.flink.api.common.typeutils.CompositeType.TypeComparatorBuilder<T extends Object> -
Constructor Summary
ConstructorsConstructorDescriptionAvroTypeInfo(Class<T> typeClass) Creates a new Avro type info for the given class. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.flink.api.common.typeutils.TypeSerializer<T>createSerializer(org.apache.flink.api.common.serialization.SerializerConfig config) Methods inherited from class org.apache.flink.api.java.typeutils.PojoTypeInfo
canEqual, createPojoSerializer, createTypeComparatorBuilder, equals, getArity, getFieldIndex, getFieldNames, getFlatFields, getPojoFieldAt, getTotalFields, getTypeAt, getTypeAt, hashCode, isBasicType, isSortKeyType, isTupleType, toStringMethods inherited from class org.apache.flink.api.common.typeutils.CompositeType
createComparator, getFlatFields, getTypeClass, hasDeterministicFieldOrder, hasField, isKeyTypeMethods inherited from class org.apache.flink.api.common.typeinfo.TypeInformation
getGenericParameters, of, of
-
Constructor Details
-
AvroTypeInfo
Creates a new Avro type info for the given class.
-
-
Method Details
-
createSerializer
public org.apache.flink.api.common.typeutils.TypeSerializer<T> createSerializer(org.apache.flink.api.common.serialization.SerializerConfig config) - Overrides:
createSerializerin classorg.apache.flink.api.java.typeutils.PojoTypeInfo<T extends org.apache.avro.specific.SpecificRecordBase>
-