Package org.apache.flink.table.types
Class UnresolvedDataType
- java.lang.Object
-
- org.apache.flink.table.types.UnresolvedDataType
-
- All Implemented Interfaces:
AbstractDataType<UnresolvedDataType>
@PublicEvolving public final class UnresolvedDataType extends Object implements AbstractDataType<UnresolvedDataType>
Partially resolved data type that requires a lookup in a catalog or configuration before creating the correspondingLogicalType
.Users are able to influence the nullability and conversion class even if the actual
LogicalType
is not fully known yet. The information is stored and verified when resolving toDataType
lazily.
-
-
Constructor Summary
Constructors Constructor Description UnresolvedDataType(Supplier<String> description, Function<DataTypeFactory,DataType> resolutionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UnresolvedDataType
bridgedTo(Class<?> newConversionClass)
Adds a hint that data should be represented using the given class when entering or leaving the table ecosystem.UnresolvedDataType
notNull()
Adds a hint that null values are not expected in the data for this type.UnresolvedDataType
nullable()
Adds a hint that null values are expected in the data for this type (default behavior).DataType
toDataType(DataTypeFactory factory)
Converts this instance to a resolvedDataType
possibly enriched with additional nullability and conversion class information.String
toString()
-
-
-
Constructor Detail
-
UnresolvedDataType
public UnresolvedDataType(Supplier<String> description, Function<DataTypeFactory,DataType> resolutionFactory)
-
-
Method Detail
-
toDataType
public DataType toDataType(DataTypeFactory factory)
Converts this instance to a resolvedDataType
possibly enriched with additional nullability and conversion class information.
-
notNull
public UnresolvedDataType notNull()
Description copied from interface:AbstractDataType
Adds a hint that null values are not expected in the data for this type.- Specified by:
notNull
in interfaceAbstractDataType<UnresolvedDataType>
- Returns:
- a new, reconfigured data type instance
-
nullable
public UnresolvedDataType 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()
.- Specified by:
nullable
in interfaceAbstractDataType<UnresolvedDataType>
- Returns:
- a new, reconfigured data type instance
-
bridgedTo
public UnresolvedDataType 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.- Specified by:
bridgedTo
in interfaceAbstractDataType<UnresolvedDataType>
- Returns:
- a new, reconfigured data type instance
-
-