Package org.apache.pinot.spi.data
Enum FieldSpec.DataType
- java.lang.Object
-
- java.lang.Enum<FieldSpec.DataType>
-
- org.apache.pinot.spi.data.FieldSpec.DataType
-
- All Implemented Interfaces:
Serializable,Comparable<FieldSpec.DataType>,java.lang.constant.Constable
- Enclosing class:
- FieldSpec
public static enum FieldSpec.DataType extends Enum<FieldSpec.DataType>
TheDataTypeenum is used to demonstrate the data type of a field.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
-
Method Summary
Modifier and Type Method Description booleancanBeASortedColumn()Checks whether the data type can be a sorted column.Objectconvert(String value)Converts the given string value to the data type.ComparableconvertInternal(String value)Converts the given string value to the data type.FieldSpec.DataTypegetStoredType()Returns the data type stored in Pinot.booleanisFixedWidth()Returnstrueif the data type is of fixed width (INT, LONG, FLOAT, DOUBLE, BOOLEAN, TIMESTAMP),falseotherwise.booleanisNumeric()Returnstrueif the data type is numeric (INT, LONG, FLOAT, DOUBLE, BIG_DECIMAL),falseotherwise.intsize()Returns the number of bytes needed to store the data type.static FieldSpec.DataTypevalueOf(String name)Returns the enum constant of this type with the specified name.static FieldSpec.DataType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INT
public static final FieldSpec.DataType INT
-
LONG
public static final FieldSpec.DataType LONG
-
FLOAT
public static final FieldSpec.DataType FLOAT
-
DOUBLE
public static final FieldSpec.DataType DOUBLE
-
BIG_DECIMAL
public static final FieldSpec.DataType BIG_DECIMAL
-
BOOLEAN
public static final FieldSpec.DataType BOOLEAN
-
TIMESTAMP
public static final FieldSpec.DataType TIMESTAMP
-
STRING
public static final FieldSpec.DataType STRING
-
JSON
public static final FieldSpec.DataType JSON
-
BYTES
public static final FieldSpec.DataType BYTES
-
STRUCT
public static final FieldSpec.DataType STRUCT
-
MAP
public static final FieldSpec.DataType MAP
-
LIST
public static final FieldSpec.DataType LIST
-
-
Method Detail
-
values
public static FieldSpec.DataType[] 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 FieldSpec.DataType 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
-
getStoredType
public FieldSpec.DataType getStoredType()
Returns the data type stored in Pinot.Pinot internally stores data (physical) in INT, LONG, FLOAT, DOUBLE, STRING, BYTES type, other data types (logical) will be stored as one of these types.
Stored type should be used when reading the physical stored values from Dictionary, Forward Index etc.
-
isFixedWidth
public boolean isFixedWidth()
Returnstrueif the data type is of fixed width (INT, LONG, FLOAT, DOUBLE, BOOLEAN, TIMESTAMP),falseotherwise.
-
size
public int size()
Returns the number of bytes needed to store the data type.
-
isNumeric
public boolean isNumeric()
Returnstrueif the data type is numeric (INT, LONG, FLOAT, DOUBLE, BIG_DECIMAL),falseotherwise.
-
convert
public Object convert(String value)
Converts the given string value to the data type. Returns byte[] for BYTES.
-
convertInternal
public Comparable convertInternal(String value)
Converts the given string value to the data type. Returns ByteArray for BYTES.
-
canBeASortedColumn
public boolean canBeASortedColumn()
Checks whether the data type can be a sorted column.
-
-