public class TypeInfoUtils extends Object
Modifier and Type | Field and Description |
---|---|
static DataTypeInfo |
BIGINT |
static DataTypeInfo |
BOOLEAN |
static DataTypeInfo |
DATE |
static DecimalTypeInfo |
DECIMAL |
static DataTypeInfo |
DOUBLE |
static DataTypeInfo |
FLOAT |
static DataTypeInfo |
INT |
static DataTypeInfo |
LONG |
static DataTypeInfo |
SHORT |
static DataTypeInfo |
SMALLINT |
static DataTypeInfo |
STRING |
static DataTypeInfo |
TIMESTAMP |
static DataTypeInfo |
TINYINT |
Modifier and Type | Method and Description |
---|---|
static ArrayTypeInfo |
getArrayTypeInfo(DataTypeInfo elementTypeInfo)
Get the data type info of a Array Type.
|
static DataTypeInfo |
getDataTypeInfo(String typeString)
Get the data type info form a type string, e.g decimal(10, 0), struct<age:int, name:string>
|
static DecimalTypeInfo |
getDecimalTypeInfo(int precision,
int scale)
Get the data type info of a Decimal.
|
static MapTypeInfo |
getMapTypeInfo(DataTypeInfo keyTypeInfo,
DataTypeInfo valueTypeInfo)
Get the data type info of a Map Type.
|
static DataTypeInfo |
getPrimitiveTypeInfo(DataType dataType)
Get the data type info of a Primitive Type.
|
static StructTypeInfo |
getStructTypeInfo(List<String> fieldNames,
List<DataTypeInfo> fieldTypeInfos)
Get the data type info of a Struct Type.
|
public static final DataTypeInfo INT
public static final DataTypeInfo SMALLINT
public static final DataTypeInfo BIGINT
public static final DataTypeInfo LONG
public static final DataTypeInfo SHORT
public static final DataTypeInfo DOUBLE
public static final DataTypeInfo FLOAT
public static final DecimalTypeInfo DECIMAL
public static final DataTypeInfo BOOLEAN
public static final DataTypeInfo STRING
public static final DataTypeInfo DATE
public static final DataTypeInfo TIMESTAMP
public static final DataTypeInfo TINYINT
public static DataTypeInfo getDataTypeInfo(String typeString)
typeString
- The data type info in String formatpublic static DataTypeInfo getPrimitiveTypeInfo(DataType dataType)
dataType
- A DataTypepublic static DecimalTypeInfo getDecimalTypeInfo(int precision, int scale)
precision
- The precision of the Decimalscale
- The scale of the Decimalpublic static StructTypeInfo getStructTypeInfo(List<String> fieldNames, List<DataTypeInfo> fieldTypeInfos)
fieldNames
- The list of the field names of the Struct TypefieldTypeInfos
- The list of the field data type info ot the Struct typepublic static ArrayTypeInfo getArrayTypeInfo(DataTypeInfo elementTypeInfo)
elementTypeInfo
- The element data type info of the Array Typepublic static MapTypeInfo getMapTypeInfo(DataTypeInfo keyTypeInfo, DataTypeInfo valueTypeInfo)
keyTypeInfo
- The key type info of the Map TypevalueTypeInfo
- The value type info of the Map TypeCopyright © 2023. All rights reserved.