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
LogicalTypeis not fully known yet. The information is stored and verified when resolving toDataTypelazily.
-
-
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 UnresolvedDataTypebridgedTo(Class<?> newConversionClass)Adds a hint that data should be represented using the given class when entering or leaving the table ecosystem.UnresolvedDataTypenotNull()Adds a hint that null values are not expected in the data for this type.UnresolvedDataTypenullable()Adds a hint that null values are expected in the data for this type (default behavior).DataTypetoDataType(DataTypeFactory factory)Converts this instance to a resolvedDataTypepossibly enriched with additional nullability and conversion class information.StringtoString()
-
-
-
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 resolvedDataTypepossibly enriched with additional nullability and conversion class information.
-
notNull
public UnresolvedDataType notNull()
Description copied from interface:AbstractDataTypeAdds a hint that null values are not expected in the data for this type.- Specified by:
notNullin interfaceAbstractDataType<UnresolvedDataType>- Returns:
- a new, reconfigured data type instance
-
nullable
public UnresolvedDataType nullable()
Description copied from interface:AbstractDataTypeAdds 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:
nullablein interfaceAbstractDataType<UnresolvedDataType>- Returns:
- a new, reconfigured data type instance
-
bridgedTo
public UnresolvedDataType bridgedTo(Class<?> newConversionClass)
Description copied from interface:AbstractDataTypeAdds 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:
bridgedToin interfaceAbstractDataType<UnresolvedDataType>- Returns:
- a new, reconfigured data type instance
-
-