Package org.apache.pinot.common.utils
Enum DataSchema.ColumnDataType
- java.lang.Object
-
- java.lang.Enum<DataSchema.ColumnDataType>
-
- org.apache.pinot.common.utils.DataSchema.ColumnDataType
-
- All Implemented Interfaces:
Serializable,Comparable<DataSchema.ColumnDataType>,java.lang.constant.Constable
- Enclosing class:
- DataSchema
public static enum DataSchema.ColumnDataType extends Enum<DataSchema.ColumnDataType>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BIG_DECIMALBOOLEANBOOLEAN_ARRAYBYTESBYTES_ARRAYDOUBLEDOUBLE_ARRAYFLOATFLOAT_ARRAYINTINT_ARRAYJSONLONGLONG_ARRAYOBJECTSTRINGSTRING_ARRAYTIMESTAMPTIMESTAMP_ARRAY
-
Method Summary
Modifier and Type Method Description Serializableconvert(Object value)Converts the given internal value to the type for external use (e.g.SerializableconvertAndFormat(Object value)Equivalent toconvert(Object)andformat(Object)with a single switch statement.Serializableformat(Object value)Formats the value to human-readable format based on the type to be used in the query response.static DataSchema.ColumnDataTypefromDataType(FieldSpec.DataType dataType, boolean isSingleValue)static DataSchema.ColumnDataTypefromDataTypeMV(FieldSpec.DataType dataType)static DataSchema.ColumnDataTypefromDataTypeSV(FieldSpec.DataType dataType)ObjectgetNullPlaceholder()DataSchema.ColumnDataTypegetStoredType()Returns the data type stored in Pinot.booleanisArray()booleanisCompatible(DataSchema.ColumnDataType anotherColumnDataType)booleanisNumber()booleanisNumberArray()booleanisSuperTypeOf(DataSchema.ColumnDataType subTypeCandidate)Determine if the candidateDataSchema.ColumnDataTypeis convertable to this type via the conversion API.booleanisWholeNumber()booleanisWholeNumberArray()FieldSpec.DataTypetoDataType()static DataSchema.ColumnDataTypevalueOf(String name)Returns the enum constant of this type with the specified name.static DataSchema.ColumnDataType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INT
public static final DataSchema.ColumnDataType INT
-
LONG
public static final DataSchema.ColumnDataType LONG
-
FLOAT
public static final DataSchema.ColumnDataType FLOAT
-
DOUBLE
public static final DataSchema.ColumnDataType DOUBLE
-
BIG_DECIMAL
public static final DataSchema.ColumnDataType BIG_DECIMAL
-
BOOLEAN
public static final DataSchema.ColumnDataType BOOLEAN
-
TIMESTAMP
public static final DataSchema.ColumnDataType TIMESTAMP
-
STRING
public static final DataSchema.ColumnDataType STRING
-
JSON
public static final DataSchema.ColumnDataType JSON
-
BYTES
public static final DataSchema.ColumnDataType BYTES
-
OBJECT
public static final DataSchema.ColumnDataType OBJECT
-
INT_ARRAY
public static final DataSchema.ColumnDataType INT_ARRAY
-
LONG_ARRAY
public static final DataSchema.ColumnDataType LONG_ARRAY
-
FLOAT_ARRAY
public static final DataSchema.ColumnDataType FLOAT_ARRAY
-
DOUBLE_ARRAY
public static final DataSchema.ColumnDataType DOUBLE_ARRAY
-
BOOLEAN_ARRAY
public static final DataSchema.ColumnDataType BOOLEAN_ARRAY
-
TIMESTAMP_ARRAY
public static final DataSchema.ColumnDataType TIMESTAMP_ARRAY
-
STRING_ARRAY
public static final DataSchema.ColumnDataType STRING_ARRAY
-
BYTES_ARRAY
public static final DataSchema.ColumnDataType BYTES_ARRAY
-
-
Method Detail
-
values
public static DataSchema.ColumnDataType[] values()
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DataSchema.ColumnDataType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getNullPlaceholder
public Object getNullPlaceholder()
-
getStoredType
public DataSchema.ColumnDataType getStoredType()
Returns the data type stored in Pinot.
-
isNumber
public boolean isNumber()
-
isWholeNumber
public boolean isWholeNumber()
-
isArray
public boolean isArray()
-
isNumberArray
public boolean isNumberArray()
-
isWholeNumberArray
public boolean isWholeNumberArray()
-
isCompatible
public boolean isCompatible(DataSchema.ColumnDataType anotherColumnDataType)
-
isSuperTypeOf
public boolean isSuperTypeOf(DataSchema.ColumnDataType subTypeCandidate)
Determine if the candidateDataSchema.ColumnDataTypeis convertable to this type via the conversion API.- Parameters:
subTypeCandidate- candidate column data type to validate.- Returns:
- true if it is a sub-type.
- See Also:
convert(Object)
-
toDataType
public FieldSpec.DataType toDataType()
-
convert
public Serializable convert(Object value)
Converts the given internal value to the type for external use (e.g. as UDF argument). The given value should be compatible with the type.
-
format
public Serializable format(Object value)
Formats the value to human-readable format based on the type to be used in the query response.
-
convertAndFormat
public Serializable convertAndFormat(Object value)
Equivalent toconvert(Object)andformat(Object)with a single switch statement.
-
fromDataType
public static DataSchema.ColumnDataType fromDataType(FieldSpec.DataType dataType, boolean isSingleValue)
-
fromDataTypeSV
public static DataSchema.ColumnDataType fromDataTypeSV(FieldSpec.DataType dataType)
-
fromDataTypeMV
public static DataSchema.ColumnDataType fromDataTypeMV(FieldSpec.DataType dataType)
-
-