Package org.apache.flink.table.types
Class KeyValueDataType
- java.lang.Object
-
- org.apache.flink.table.types.DataType
-
- org.apache.flink.table.types.KeyValueDataType
-
- All Implemented Interfaces:
Serializable
,AbstractDataType<DataType>
@PublicEvolving public final class KeyValueDataType extends DataType
A data type that contains a key and value data type (e.g.MAP
).
-
-
Field Summary
-
Fields inherited from class org.apache.flink.table.types.DataType
conversionClass, logicalType
-
-
Constructor Summary
Constructors Constructor Description KeyValueDataType(LogicalType logicalType, Class<?> conversionClass, DataType keyDataType, DataType valueDataType)
KeyValueDataType(LogicalType logicalType, DataType keyDataType, DataType valueDataType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> R
accept(DataTypeVisitor<R> visitor)
DataType
bridgedTo(Class<?> newConversionClass)
Adds a hint that data should be represented using the given class when entering or leaving the table ecosystem.boolean
equals(Object o)
List<DataType>
getChildren()
Returns the children of this data type, if any.DataType
getKeyDataType()
DataType
getValueDataType()
int
hashCode()
DataType
notNull()
Adds a hint that null values are not expected in the data for this type.DataType
nullable()
Adds a hint that null values are expected in the data for this type (default behavior).-
Methods inherited from class org.apache.flink.table.types.DataType
getConversionClass, getFieldCount, getFieldDataTypes, getFieldNames, getFields, getLogicalType, toInternal, toString
-
-
-
-
Constructor Detail
-
KeyValueDataType
public KeyValueDataType(LogicalType logicalType, @Nullable Class<?> conversionClass, DataType keyDataType, DataType valueDataType)
-
KeyValueDataType
public KeyValueDataType(LogicalType logicalType, DataType keyDataType, DataType valueDataType)
-
-
Method Detail
-
getKeyDataType
public DataType getKeyDataType()
-
getValueDataType
public DataType getValueDataType()
-
notNull
public DataType notNull()
Description copied from interface:AbstractDataType
Adds a hint that null values are not expected in the data for this type.- Returns:
- a new, reconfigured data type instance
-
nullable
public DataType nullable()
Description copied from interface:AbstractDataType
Adds a hint that null values are expected in the data for this type (default behavior).This method exists for explicit declaration of the default behavior or for invalidation of a previous call to
AbstractDataType.notNull()
.- Returns:
- a new, reconfigured data type instance
-
bridgedTo
public DataType bridgedTo(Class<?> newConversionClass)
Description copied from interface:AbstractDataType
Adds a hint that data should be represented using the given class when entering or leaving the table ecosystem.A supported conversion class depends on the logical type and its nullability property.
Please see the implementation of
LogicalType.supportsInputConversion(Class)
,LogicalType.supportsOutputConversion(Class)
, or the documentation for more information about supported conversions.- Returns:
- a new, reconfigured data type instance
-
getChildren
public List<DataType> getChildren()
Description copied from class:DataType
Returns the children of this data type, if any. Returns an empty list if this data type is atomic.- Specified by:
getChildren
in classDataType
- Returns:
- the children data types
-
accept
public <R> R accept(DataTypeVisitor<R> visitor)
-
-