@Public public abstract class CompositeType<T> extends TypeInformation<T>
The class is taking care of serialization and comparators for Tuples as well.
Modifier and Type | Class and Description |
---|---|
static class |
CompositeType.FlatFieldDescriptor |
static class |
CompositeType.InvalidFieldReferenceException |
protected static interface |
CompositeType.TypeComparatorBuilder<T> |
Constructor and Description |
---|
CompositeType(Class<T> typeClass) |
Modifier and Type | Method and Description |
---|---|
boolean |
canEqual(Object obj)
Returns true if the given object can be equaled with this object.
|
TypeComparator<T> |
createComparator(int[] logicalKeyFields,
boolean[] orders,
int logicalFieldOffset,
ExecutionConfig config)
Generic implementation of the comparator creation.
|
protected abstract CompositeType.TypeComparatorBuilder<T> |
createTypeComparatorBuilder() |
boolean |
equals(Object obj) |
abstract int |
getFieldIndex(String fieldName)
Returns the field index of the composite field of the given name.
|
abstract String[] |
getFieldNames()
Returns the names of the composite fields of this type.
|
List<CompositeType.FlatFieldDescriptor> |
getFlatFields(String fieldExpression)
Returns the flat field descriptors for the given field expression.
|
abstract void |
getFlatFields(String fieldExpression,
int offset,
List<CompositeType.FlatFieldDescriptor> result)
Computes the flat field descriptors for the given field expression with the given offset.
|
abstract <X> TypeInformation<X> |
getTypeAt(int pos)
Returns the type of the (unnested) field at the given field position.
|
abstract <X> TypeInformation<X> |
getTypeAt(String fieldExpression)
Returns the type of the (nested) field at the given field expression position.
|
Class<T> |
getTypeClass()
Returns the type class of the composite type
|
boolean |
hasDeterministicFieldOrder()
True if this type has an inherent ordering of the fields, such that a user can always be sure
in which order the fields will be in.
|
boolean |
hasField(String fieldName)
Returns true when this type has a composite field with the given name.
|
int |
hashCode() |
boolean |
isKeyType()
Checks whether this type can be used as a key.
|
boolean |
isSortKeyType()
Checks whether this type can be used as a key for sorting.
|
String |
toString() |
createSerializer, createSerializer, getArity, getGenericParameters, getTotalFields, isBasicType, isTupleType, of, of
@PublicEvolving public CompositeType(Class<T> typeClass)
@PublicEvolving public Class<T> getTypeClass()
getTypeClass
in class TypeInformation<T>
@PublicEvolving public List<CompositeType.FlatFieldDescriptor> getFlatFields(String fieldExpression)
fieldExpression
- The field expression for which the flat field descriptors are
computed.@PublicEvolving public abstract void getFlatFields(String fieldExpression, int offset, List<CompositeType.FlatFieldDescriptor> result)
fieldExpression
- The field expression for which the FlatFieldDescriptors are computed.offset
- The offset to use when computing the positions of the flat fields.result
- The list into which all flat field descriptors are inserted.@PublicEvolving public abstract <X> TypeInformation<X> getTypeAt(String fieldExpression)
fieldExpression
- The field expression for which the field of which the type is
returned.@PublicEvolving public abstract <X> TypeInformation<X> getTypeAt(int pos)
pos
- The position of the (unnested) field in this composite type.@PublicEvolving protected abstract CompositeType.TypeComparatorBuilder<T> createTypeComparatorBuilder()
@PublicEvolving public TypeComparator<T> createComparator(int[] logicalKeyFields, boolean[] orders, int logicalFieldOffset, ExecutionConfig config)
@PublicEvolving public boolean hasField(String fieldName)
@PublicEvolving public boolean isKeyType()
TypeInformation
isKeyType
in class TypeInformation<T>
@PublicEvolving public boolean isSortKeyType()
TypeInformation
isSortKeyType
in class TypeInformation<T>
@PublicEvolving public abstract String[] getFieldNames()
@PublicEvolving public boolean hasDeterministicFieldOrder()
This is used when translating a DataSet or DataStream to an Expression Table, when initially renaming the fields of the underlying type.
@PublicEvolving public abstract int getFieldIndex(String fieldName)
public boolean equals(Object obj)
equals
in class TypeInformation<T>
public int hashCode()
hashCode
in class TypeInformation<T>
public boolean canEqual(Object obj)
TypeInformation
canEqual
in class TypeInformation<T>
obj
- Object which wants to take part in the equality relationpublic String toString()
toString
in class TypeInformation<T>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.