Package ai.rapids.cudf
Class DType
java.lang.Object
ai.rapids.cudf.DType
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DTypestatic final intstatic final intstatic final intstatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DTypestatic final DType -
Method Summary
Modifier and TypeMethodDescriptionstatic DTypeFactory method for non-decimal DType instances.static DTypecreate(DType.DTypeEnum dt, int scale) Factory method specialized for decimal DType instances.booleanstatic DTypeCreate decimal-like DType using precision and scale of Java BigDecimal.static DTypefromNative(int nativeId, int scale) Factory method for DType instancesintReturns max precision for Decimal Type.intGet the number of decimal places needed to hold the Integral Type.intgetScale()Returns scale for Decimal Type.intThis only works for fixed width types.Return enum for this DTypeinthashCode()booleanReturns true if the type uses a vector of offsetsbooleanReturns true for timestamps with time level resolution, as opposed to day level resolutionbooleanReturns true if this type is backed by byte type Namely this method will return true for the following types DType.INT8, DType.UINT8, DType.BOOL8booleanReturns 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.DECIMAL32booleanReturns 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.DECIMAL64booleanReturns true if this type is backed by short type Namely this method will return true for the following types DType.INT16, DType.UINT16booleanReturns true if this type is of decimal type Namely this method will return true for the following types DType.DECIMAL32, DType.DECIMAL64booleanReturns true for duration typesbooleanReturns true for strictly Integer types not a type backed by intsbooleanReturns true for nested typesbooleanDeprecated.booleantoString()
-
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
-