@PublicEvolving public final class LogicalTypeParser extends Object
LogicalType from a serialized string created with
LogicalType.asSerializableString().
In addition to the serializable string representations, this parser also supports common shortcuts for certain types. This includes:
STRING as a synonym for VARCHAR(INT_MAX)BYTES as a synonym for VARBINARY(INT_MAX)NUMERIC and DEC as synonyms for DECIMALINTEGER as a synonym for INTDOUBLE PRECISION as a synonym for DOUBLETIME WITHOUT TIME ZONE as a synonym for TIMETIMESTAMP WITHOUT TIME ZONE as a synonym for TIMESTAMPtype ARRAY as a synonym for ARRAY<type>type MULTISET as a synonym for MULTISET<type>ROW(...) as a synonym for ROW<...>type NULL as a synonym for typeFurthermore, it returns UnresolvedUserDefinedType for unknown types (partially or fully
qualified such as [catalog].[database].[type]).
| Constructor and Description |
|---|
LogicalTypeParser() |
| Modifier and Type | Method and Description |
|---|---|
static LogicalType |
parse(String typeString)
Parses a type string.
|
static LogicalType |
parse(String typeString,
ClassLoader classLoader)
Parses a type string.
|
public static LogicalType parse(String typeString, ClassLoader classLoader)
UnresolvedUserDefinedTypes.typeString - a string like "ROW(field1 INT, field2 BOOLEAN)"classLoader - class loader for loading classes of the RAW typeValidationException - in case of parsing errors.public static LogicalType parse(String typeString)
UnresolvedUserDefinedTypes.typeString - a string like "ROW(field1 INT, field2 BOOLEAN)"ValidationException - in case of parsing errors.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.