@Internal public final class ClassDataTypeConverter extends Object
Note: In most of the cases, DataTypeExtractor
is more useful as it also considers
structured types and type variables possibly annotated with DataTypeHint
.
Modifier and Type | Method and Description |
---|---|
static Optional<DataType> |
extractDataType(Class<?> clazz)
Returns the clearly identifiable data type if possible.
|
public static Optional<DataType> extractDataType(Class<?> clazz)
Long
can be
expressed as DataTypes.BIGINT()
. However, for example, Row
cannot be
extracted as information about the fields is missing. Or BigDecimal
needs to be
mapped from a variable precision/scale to constant ones.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.