Package ai.rapids.cudf
Class DType
java.lang.Object
ai.rapids.cudf.DType
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DType
static final int
static final int
static final int
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
static final DType
-
Method Summary
Modifier and TypeMethodDescriptionstatic DType
Factory method for non-decimal DType instances.static DType
create
(DType.DTypeEnum dt, int scale) Factory method specialized for decimal DType instances.boolean
static DType
Create decimal-like DType using precision and scale of Java BigDecimal.static DType
fromNative
(int nativeId, int scale) Factory method for DType instancesint
Returns max precision for Decimal Type.int
Get the number of decimal places needed to hold the Integral Type.int
getScale()
Returns scale for Decimal Type.int
This only works for fixed width types.Return enum for this DTypeint
hashCode()
boolean
Returns true if the type uses a vector of offsetsboolean
Returns true for timestamps with time level resolution, as opposed to day level resolutionboolean
Returns true if this type is backed by byte type Namely this method will return true for the following types DType.INT8, DType.UINT8, DType.BOOL8boolean
Returns true if this type is backed by int type Namely this method will return true for the following types DType.INT32, DType.UINT32, DType.DURATION_DAYS, DType.TIMESTAMP_DAYS, DType.DECIMAL32boolean
Returns true if this type is backed by long type Namely this method will return true for the following types DType.INT64, DType.UINT64, DType.DURATION_SECONDS, DType.DURATION_MILLISECONDS, DType.DURATION_MICROSECONDS, DType.DURATION_NANOSECONDS, DType.TIMESTAMP_SECONDS, DType.TIMESTAMP_MILLISECONDS, DType.TIMESTAMP_MICROSECONDS, DType.TIMESTAMP_NANOSECONDS, DType.DECIMAL64boolean
Returns true if this type is backed by short type Namely this method will return true for the following types DType.INT16, DType.UINT16boolean
Returns true if this type is of decimal type Namely this method will return true for the following types DType.DECIMAL32, DType.DECIMAL64boolean
Returns true for duration typesboolean
Returns true for strictly Integer types not a type backed by intsboolean
Returns true for nested typesboolean
Deprecated.boolean
toString()
-
Field Details
-
DECIMAL32_MAX_PRECISION
public static final int DECIMAL32_MAX_PRECISION- See Also:
-
DECIMAL64_MAX_PRECISION
public static final int DECIMAL64_MAX_PRECISION- See Also:
-
DECIMAL128_MAX_PRECISION
public static final int DECIMAL128_MAX_PRECISION- See Also:
-
EMPTY
-
INT8
-
INT16
-
INT32
-
INT64
-
UINT8
-
UINT16
-
UINT32
-
UINT64
-
FLOAT32
-
FLOAT64
-
BOOL8
-
TIMESTAMP_DAYS
-
TIMESTAMP_SECONDS
-
TIMESTAMP_MILLISECONDS
-
TIMESTAMP_MICROSECONDS
-
TIMESTAMP_NANOSECONDS
-
DURATION_DAYS
-
DURATION_SECONDS
-
DURATION_MILLISECONDS
-
DURATION_MICROSECONDS
-
DURATION_NANOSECONDS
-
STRING
-
LIST
-
STRUCT
-
-
Method Details
-
getDecimalMaxPrecision
public int getDecimalMaxPrecision()Returns max precision for Decimal Type.- Returns:
- max precision this Decimal Type can hold
-
getPrecisionForInt
public int getPrecisionForInt()Get the number of decimal places needed to hold the Integral Type. NOTE: this method is NOT for Decimal Type but for Integral Type.- Returns:
- the minimum decimal precision (places) for Integral Type
-
getSizeInBytes
public int getSizeInBytes()This only works for fixed width types. Variable width types like strings the value is undefined and should be ignored.- Returns:
- size of type in bytes.
-
getScale
public int getScale()Returns scale for Decimal Type.- Returns:
- scale base-10 exponent to multiply the unscaled value to produce the decimal value. Example: Consider unscaled value = 123456 if scale = -2, decimal value = 123456 * 10^-2 = 1234.56 if scale = 2, decimal value = 123456 * 10^2 = 12345600
-
getTypeId
Return enum for this DType- Returns:
- DTypeEnum
-
equals
-
hashCode
public int hashCode() -
toString
-
create
Factory method for non-decimal DType instances.- Parameters:
dt
- enum corresponding to datatype.- Returns:
- DType
-
create
Factory method specialized for decimal DType instances.- Parameters:
dt
- enum corresponding to datatype.scale
- base-10 exponent to multiply the unscaled value to produce the decimal value. Example: Consider unscaled value = 123456 if scale = -2, decimal value = 123456 * 10^-2 = 1234.56 if scale = 2, decimal value = 123456 * 10^2 = 12345600- Returns:
- DType
-
fromNative
Factory method for DType instances- Parameters:
nativeId
- nativeId of DataTypeEnunscale
- base-10 exponent to multiply the unscaled value to produce the decimal value Example: Consider unscaled value = 123456 if scale = -2, decimal value = 123456 * 10^-2 = 1234.56 if scale = 2, decimal value = 123456 * 10^2 = 12345600- Returns:
- DType
-
fromJavaBigDecimal
Create decimal-like DType using precision and scale of Java BigDecimal.- Parameters:
dec
- BigDecimal- Returns:
- DType
-
hasTimeResolution
public boolean hasTimeResolution()Returns true for timestamps with time level resolution, as opposed to day level resolution -
isBackedByInt
public boolean isBackedByInt()Returns true if this type is backed by int type Namely this method will return true for the following types DType.INT32, DType.UINT32, DType.DURATION_DAYS, DType.TIMESTAMP_DAYS, DType.DECIMAL32 -
isBackedByLong
public boolean isBackedByLong()Returns true if this type is backed by long type Namely this method will return true for the following types DType.INT64, DType.UINT64, DType.DURATION_SECONDS, DType.DURATION_MILLISECONDS, DType.DURATION_MICROSECONDS, DType.DURATION_NANOSECONDS, DType.TIMESTAMP_SECONDS, DType.TIMESTAMP_MILLISECONDS, DType.TIMESTAMP_MICROSECONDS, DType.TIMESTAMP_NANOSECONDS, DType.DECIMAL64 -
isBackedByShort
public boolean isBackedByShort()Returns true if this type is backed by short type Namely this method will return true for the following types DType.INT16, DType.UINT16 -
isBackedByByte
public boolean isBackedByByte()Returns true if this type is backed by byte type Namely this method will return true for the following types DType.INT8, DType.UINT8, DType.BOOL8 -
isDecimalType
public boolean isDecimalType()Returns true if this type is of decimal type Namely this method will return true for the following types DType.DECIMAL32, DType.DECIMAL64 -
isDurationType
public boolean isDurationType()Returns true for duration types -
isIntegral
public boolean isIntegral()Returns true for strictly Integer types not a type backed by ints -
isNestedType
public boolean isNestedType()Returns true for nested types -
isTimestamp
Deprecated. -
isTimestampType
public boolean isTimestampType() -
hasOffsets
public boolean hasOffsets()Returns true if the type uses a vector of offsets
-