public final class DType extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DType.DTypeEnum |
Modifier and Type | Field and Description |
---|---|
static DType |
BOOL8 |
static int |
DECIMAL128_MAX_PRECISION |
static int |
DECIMAL32_MAX_PRECISION |
static int |
DECIMAL64_MAX_PRECISION |
static DType |
DURATION_DAYS |
static DType |
DURATION_MICROSECONDS |
static DType |
DURATION_MILLISECONDS |
static DType |
DURATION_NANOSECONDS |
static DType |
DURATION_SECONDS |
static DType |
EMPTY |
static DType |
FLOAT32 |
static DType |
FLOAT64 |
static DType |
INT16 |
static DType |
INT32 |
static DType |
INT64 |
static DType |
INT8 |
static DType |
LIST |
static DType |
STRING |
static DType |
STRUCT |
static DType |
TIMESTAMP_DAYS |
static DType |
TIMESTAMP_MICROSECONDS |
static DType |
TIMESTAMP_MILLISECONDS |
static DType |
TIMESTAMP_NANOSECONDS |
static DType |
TIMESTAMP_SECONDS |
static DType |
UINT16 |
static DType |
UINT32 |
static DType |
UINT64 |
static DType |
UINT8 |
Modifier and Type | Method and Description |
---|---|
static DType |
create(DType.DTypeEnum dt)
Factory method for non-decimal DType instances.
|
static DType |
create(DType.DTypeEnum dt,
int scale)
Factory method specialized for decimal DType instances.
|
boolean |
equals(Object o) |
static DType |
fromJavaBigDecimal(BigDecimal dec)
Create decimal-like DType using precision and scale of Java BigDecimal.
|
static DType |
fromNative(int nativeId,
int scale)
Factory method for DType instances
|
int |
getDecimalMaxPrecision()
Returns max precision for Decimal Type.
|
int |
getPrecisionForInt()
Get the number of decimal places needed to hold the Integral Type.
|
int |
getScale()
Returns scale for Decimal Type.
|
int |
getSizeInBytes()
This only works for fixed width types.
|
DType.DTypeEnum |
getTypeId()
Return enum for this DType
|
int |
hashCode() |
boolean |
hasOffsets()
Returns true if the type uses a vector of offsets
|
boolean |
hasTimeResolution()
Returns true for timestamps with time level resolution, as opposed to day level resolution
|
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
|
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
|
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
|
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
|
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
|
boolean |
isDurationType()
Returns true for duration types
|
boolean |
isIntegral()
Returns true for strictly Integer types not a type backed by
ints
|
boolean |
isNestedType()
Returns true for nested types
|
boolean |
isTimestamp()
Deprecated.
|
boolean |
isTimestampType() |
String |
toString() |
public static final int DECIMAL32_MAX_PRECISION
public static final int DECIMAL64_MAX_PRECISION
public static final int DECIMAL128_MAX_PRECISION
public static final DType EMPTY
public static final DType INT8
public static final DType INT16
public static final DType INT32
public static final DType INT64
public static final DType UINT8
public static final DType UINT16
public static final DType UINT32
public static final DType UINT64
public static final DType FLOAT32
public static final DType FLOAT64
public static final DType BOOL8
public static final DType TIMESTAMP_DAYS
public static final DType TIMESTAMP_SECONDS
public static final DType TIMESTAMP_MILLISECONDS
public static final DType TIMESTAMP_MICROSECONDS
public static final DType TIMESTAMP_NANOSECONDS
public static final DType DURATION_DAYS
public static final DType DURATION_SECONDS
public static final DType DURATION_MILLISECONDS
public static final DType DURATION_MICROSECONDS
public static final DType DURATION_NANOSECONDS
public static final DType STRING
public static final DType LIST
public static final DType STRUCT
public int getDecimalMaxPrecision()
public int getPrecisionForInt()
public int getSizeInBytes()
public int getScale()
public DType.DTypeEnum getTypeId()
public static DType create(DType.DTypeEnum dt)
dt
- enum corresponding to datatype.public static DType create(DType.DTypeEnum dt, int scale)
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 = 12345600public static DType fromNative(int nativeId, int scale)
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 = 12345600public static DType fromJavaBigDecimal(BigDecimal dec)
dec
- BigDecimalpublic boolean hasTimeResolution()
public boolean isBackedByInt()
public boolean isBackedByLong()
public boolean isBackedByShort()
public boolean isBackedByByte()
public boolean isDecimalType()
public boolean isDurationType()
public boolean isIntegral()
public boolean isNestedType()
@Deprecated public boolean isTimestamp()
public boolean isTimestampType()
public boolean hasOffsets()
Copyright © 2024. All rights reserved.