@PublicEvolving public class RowTypeInfo extends TupleTypeInfoBase<Row>
TypeInformation
for Row
.
Note: The implementations of hashCode()
and equals(Object)
do not check
field names because those don't matter during serialization and runtime. This might change in
future versions. See FLINK-14438 for more information.
CompositeType.FlatFieldDescriptor, CompositeType.InvalidFieldReferenceException, CompositeType.TypeComparatorBuilder<T>
Modifier and Type | Field and Description |
---|---|
protected String[] |
fieldNames |
types
Constructor and Description |
---|
RowTypeInfo(TypeInformation<?>... types) |
RowTypeInfo(TypeInformation<?>[] types,
String[] fieldNames) |
Modifier and Type | Method and Description |
---|---|
boolean |
canEqual(Object obj)
Returns true if the given object can be equaled with this object.
|
TypeComparator<Row> |
createComparator(int[] logicalKeyFields,
boolean[] orders,
int logicalFieldOffset,
ExecutionConfig config)
Generic implementation of the comparator creation.
|
TypeSerializer<Row> |
createLegacySerializer(SerializerConfig config)
Deprecated.
|
TypeSerializer<Row> |
createSerializer(ExecutionConfig config)
Create
TypeSerializer for this type. |
TypeSerializer<Row> |
createSerializer(SerializerConfig config)
Creates a serializer for the type.
|
protected CompositeType.TypeComparatorBuilder<Row> |
createTypeComparatorBuilder() |
boolean |
equals(Object obj)
The equals method does only check for field types.
|
int |
getFieldIndex(String fieldName)
Returns the field index of the composite field of the given name.
|
String[] |
getFieldNames()
Returns the names of the composite fields of this type.
|
void |
getFlatFields(String fieldExpression,
int offset,
List<CompositeType.FlatFieldDescriptor> result)
Computes the flat field descriptors for the given field expression with the given offset.
|
<X> TypeInformation<X> |
getTypeAt(String fieldExpression)
Returns the type of the (nested) field at the given field expression position.
|
int |
hashCode() |
static RowTypeInfo |
projectFields(RowTypeInfo rowType,
int[] fieldMapping)
Creates a
RowTypeInfo with projected fields. |
boolean |
schemaEquals(Object obj)
Tests whether an other object describes the same, schema-equivalent row information.
|
String |
toString() |
getArity, getFieldTypes, getTotalFields, getTypeAt, hasDeterministicFieldOrder, isBasicType, isCaseClass, isTupleType
getFlatFields, getTypeClass, hasField, isKeyType, isSortKeyType
getGenericParameters, of, of
protected final String[] fieldNames
public RowTypeInfo(TypeInformation<?>... types)
public RowTypeInfo(TypeInformation<?>[] types, String[] fieldNames)
public void getFlatFields(String fieldExpression, int offset, List<CompositeType.FlatFieldDescriptor> result)
CompositeType
getFlatFields
in class TupleTypeInfoBase<Row>
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.public <X> TypeInformation<X> getTypeAt(String fieldExpression)
CompositeType
getTypeAt
in class TupleTypeInfoBase<Row>
fieldExpression
- The field expression for which the field of which the type is
returned.public TypeComparator<Row> createComparator(int[] logicalKeyFields, boolean[] orders, int logicalFieldOffset, ExecutionConfig config)
CompositeType
createComparator
in class CompositeType<Row>
protected CompositeType.TypeComparatorBuilder<Row> createTypeComparatorBuilder()
createTypeComparatorBuilder
in class CompositeType<Row>
public String[] getFieldNames()
CompositeType
getFieldNames
in class CompositeType<Row>
public int getFieldIndex(String fieldName)
CompositeType
getFieldIndex
in class CompositeType<Row>
public TypeSerializer<Row> createSerializer(SerializerConfig config)
TypeInformation
createSerializer
in class TypeInformation<Row>
config
- The config used to parameterize the serializer.public TypeSerializer<Row> createSerializer(ExecutionConfig config)
TypeInformation
TypeSerializer
for this type.createSerializer
in class TypeInformation<Row>
config
- the configuration of this job executionpublic boolean canEqual(Object obj)
TypeInformation
canEqual
in class TupleTypeInfoBase<Row>
obj
- Object which wants to take part in the equality relationpublic int hashCode()
hashCode
in class TupleTypeInfoBase<Row>
public boolean equals(Object obj)
schemaEquals(Object)
for checking schema-equivalence.equals
in class TupleTypeInfoBase<Row>
public String toString()
toString
in class TupleTypeInfoBase<Row>
@Deprecated public TypeSerializer<Row> createLegacySerializer(SerializerConfig config)
Row
format before Flink 1.11.
The serialization format has changed from 1.10 to 1.11 and added Row.getKind()
.
public boolean schemaEquals(Object obj)
public static RowTypeInfo projectFields(RowTypeInfo rowType, int[] fieldMapping)
RowTypeInfo
with projected fields.rowType
- The original RowTypeInfo whose fields are projectedfieldMapping
- The field mapping of the projectionCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.