| Modifier and Type | Method and Description |
|---|---|
static int |
getFieldCount(DataType dataType)
Returns the field count of row and structured types.
|
static List<String> |
getFieldNames(DataType dataType)
Returns the field names of row and structured types.
|
static List<DataType> |
getFieldTypes(DataType dataType)
Returns the field types of row and structured types.
|
static int |
getLength(DataType dataType) |
static List<DataType> |
getNestedTypes(DataType dataType) |
static Integer |
getPrecision(DataType dataType)
Returns the precision of all types that define a precision implicitly or explicitly.
|
static int |
getScale(DataType dataType)
Returns the scale of all types that define a scale implicitly or explicitly.
|
static boolean |
hasLength(DataType dataType,
int length) |
static boolean |
hasPrecision(DataType dataType,
int precision)
Checks the precision of a type that defines a precision implicitly or explicitly.
|
static boolean |
hasScale(DataType dataType,
int scale)
Checks the scale of all types that define a scale implicitly or explicitly.
|
static boolean |
hasWellDefinedString(DataType dataType)
Checks whether the given
DataType has a well-defined string representation when
calling Object.toString() on the internal data structure. |
static boolean |
isCompositeType(DataType dataType)
Checks if the given type is a composite type.
|
public static boolean isCompositeType(DataType dataType)
Use getFieldCount(DataType), getFieldNames(DataType), getFieldTypes(DataType) for unified handling of composite types.
public static int getLength(DataType dataType)
public static boolean hasLength(DataType dataType, int length)
public static Integer getPrecision(@Nullable DataType dataType)
public static boolean hasPrecision(DataType dataType, int precision)
public static int getScale(DataType dataType)
public static boolean hasScale(DataType dataType, int scale)
public static int getFieldCount(DataType dataType)
public static List<String> getFieldNames(DataType dataType)
public static List<DataType> getFieldTypes(DataType dataType)
public static boolean hasWellDefinedString(DataType dataType)
DataType has a well-defined string representation when
calling Object.toString() on the internal data structure. The string representation
would be similar in SQL or in a programming language.
Note: This method might not be necessary anymore, once we have implemented a utility that can convert any internal data structure to a well-defined string representation.
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.