@Internal public class FieldInfoUtils extends Object
TypeInformations.| Modifier and Type | Class and Description |
|---|---|
static class |
FieldInfoUtils.TypeInfoSchema
Describes fields' names, indices and
DataTypes extracted from a TypeInformation and possibly transformed via Expression application. |
| Modifier and Type | Method and Description |
|---|---|
static int[] |
getFieldIndices(org.apache.flink.api.common.typeinfo.TypeInformation<?> inputType)
Returns field indexes for a given
TypeInformation. |
static <A> String[] |
getFieldNames(org.apache.flink.api.common.typeinfo.TypeInformation<A> inputType)
Returns field names for a given
TypeInformation. |
static <A> String[] |
getFieldNames(org.apache.flink.api.common.typeinfo.TypeInformation<A> inputType,
List<String> existingNames)
Returns field names for a given
TypeInformation. |
static <A> FieldInfoUtils.TypeInfoSchema |
getFieldsInfo(org.apache.flink.api.common.typeinfo.TypeInformation<A> inputType)
Returns a
FieldInfoUtils.TypeInfoSchema for a given TypeInformation. |
static <A> FieldInfoUtils.TypeInfoSchema |
getFieldsInfo(org.apache.flink.api.common.typeinfo.TypeInformation<A> inputType,
org.apache.flink.table.expressions.Expression[] expressions)
Returns a
FieldInfoUtils.TypeInfoSchema for a given TypeInformation. |
static org.apache.flink.api.common.typeinfo.TypeInformation<?>[] |
getFieldTypes(org.apache.flink.api.common.typeinfo.TypeInformation<?> inputType)
Returns field types for a given
TypeInformation. |
static <A> void |
validateInputTypeInfo(org.apache.flink.api.common.typeinfo.TypeInformation<A> typeInfo)
Validate if class represented by the typeInfo is static and globally accessible.
|
public static <A> FieldInfoUtils.TypeInfoSchema getFieldsInfo(org.apache.flink.api.common.typeinfo.TypeInformation<A> inputType)
FieldInfoUtils.TypeInfoSchema for a given TypeInformation.A - The type of the TypeInformation.inputType - The TypeInformation to extract the mapping from.TableSchema.FieldInfoUtils.TypeInfoSchemapublic static <A> FieldInfoUtils.TypeInfoSchema getFieldsInfo(org.apache.flink.api.common.typeinfo.TypeInformation<A> inputType, org.apache.flink.table.expressions.Expression[] expressions)
FieldInfoUtils.TypeInfoSchema for a given TypeInformation. It gives control of the
process of mapping TypeInformation to TableSchema (via FieldInfoUtils.TypeInfoSchema).
Possible operations via the expressions include:
TimestampType.
A - The type of the TypeInformation.inputType - The TypeInformation to extract the mapping from.expressions - Expressions to apply while extracting the mapping.TableSchema.FieldInfoUtils.TypeInfoSchemapublic static <A> String[] getFieldNames(org.apache.flink.api.common.typeinfo.TypeInformation<A> inputType)
TypeInformation.A - The type of the TypeInformation.inputType - The TypeInformation extract the field names.public static <A> String[] getFieldNames(org.apache.flink.api.common.typeinfo.TypeInformation<A> inputType, List<String> existingNames)
TypeInformation. If the input TypeInformation
is not a composite type, the result field name should not exist in the existingNames.A - The type of the TypeInformation.inputType - The TypeInformation extract the field names.existingNames - The existing field names for non-composite types that can not be used.public static <A> void validateInputTypeInfo(org.apache.flink.api.common.typeinfo.TypeInformation<A> typeInfo)
typeInfo - type to checkorg.apache.flink.table.api.ValidationException - if type does not meet these criteriapublic static int[] getFieldIndices(org.apache.flink.api.common.typeinfo.TypeInformation<?> inputType)
TypeInformation.inputType - The TypeInformation extract the field positions from.public static org.apache.flink.api.common.typeinfo.TypeInformation<?>[] getFieldTypes(org.apache.flink.api.common.typeinfo.TypeInformation<?> inputType)
TypeInformation.inputType - The TypeInformation to extract field types from.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.