@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 DECIMAL
INTEGER as a synonym for INT
DOUBLE PRECISION as a synonym for DOUBLE
TIME WITHOUT TIME ZONE as a synonym for TIME
TIMESTAMP WITHOUT TIME ZONE as a synonym for TIMESTAMP
type 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 type
Furthermore, it returns UnresolvedUserDefinedType for unknown types (partially or
fully qualified such as [catalog].[database].[type]).
| 构造器和说明 |
|---|
LogicalTypeParser() |
| 限定符和类型 | 方法和说明 |
|---|---|
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–2021 The Apache Software Foundation. All rights reserved.