Class LogicalTypeParser
- java.lang.Object
-
- org.apache.flink.table.types.logical.utils.LogicalTypeParser
-
@PublicEvolving public final class LogicalTypeParser extends Object
Parser for creating instances ofLogicalType
from a serialized string created withLogicalType.asSerializableString()
.In addition to the serializable string representations, this parser also supports common shortcuts for certain types. This includes:
STRING
as a synonym forVARCHAR(INT_MAX)
BYTES
as a synonym forVARBINARY(INT_MAX)
NUMERIC
andDEC
as synonyms forDECIMAL
INTEGER
as a synonym forINT
DOUBLE PRECISION
as a synonym forDOUBLE
TIME WITHOUT TIME ZONE
as a synonym forTIME
TIMESTAMP WITHOUT TIME ZONE
as a synonym forTIMESTAMP
TIMESTAMP WITH LOCAL TIME ZONE
as a synonym forTIMESTAMP_LTZ
type ARRAY
as a synonym forARRAY<type>
type MULTISET
as a synonym forMULTISET<type>
ROW(...)
as a synonym forROW<...>
type NULL
as a synonym fortype
Furthermore, it returns
UnresolvedUserDefinedType
for unknown types (partially or fully qualified such as[catalog].[database].[type]
).
-
-
Constructor Summary
Constructors Constructor Description LogicalTypeParser()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static LogicalType
parse(String typeString)
Deprecated.You should useparse(String, ClassLoader)
to correctly load user typesstatic LogicalType
parse(String typeString, ClassLoader classLoader)
Parses a type string.
-
-
-
Method Detail
-
parse
public static LogicalType parse(String typeString, ClassLoader classLoader)
Parses a type string. All types will be fully resolved except forUnresolvedUserDefinedType
s.- Parameters:
typeString
- a string like "ROW(field1 INT, field2 BOOLEAN)"classLoader
- class loader for loading classes of the RAW type- Throws:
ValidationException
- in case of parsing errors.
-
parse
@Deprecated public static LogicalType parse(String typeString)
Deprecated.You should useparse(String, ClassLoader)
to correctly load user typesParses a type string. All types will be fully resolved except forUnresolvedUserDefinedType
s.- Parameters:
typeString
- a string like "ROW(field1 INT, field2 BOOLEAN)"- Throws:
ValidationException
- in case of parsing errors.
-
-