public class DecimalType extends NumericType implements scala.Product, scala.Serializable
java.math.BigDecimal
values.
A Decimal that must have fixed precision (the maximum number of digits) and scale (the number
of digits on right side of dot).
The precision can be up to 38, scale can also be up to 38 (less or equal to precision).
The default precision and scale is (10, 0).
Please use DataTypes.createDecimalType()
to create a specific instance.
Modifier and Type | Class and Description |
---|---|
static class |
DecimalType.Expression$ |
static class |
DecimalType.Fixed$ |
Constructor and Description |
---|
DecimalType() |
DecimalType(int precision) |
DecimalType(int precision,
int scale) |
Modifier and Type | Method and Description |
---|---|
abstract static boolean |
canEqual(Object that) |
static String |
catalogString() |
int |
defaultSize()
The default size of a value of the DecimalType is 8 bytes when precision is at most 18,
and 16 bytes otherwise.
|
abstract static boolean |
equals(Object that) |
static boolean |
is32BitDecimalType(DataType dt)
Returns if dt is a DecimalType that fits inside an int
|
static boolean |
is64BitDecimalType(DataType dt)
Returns if dt is a DecimalType that fits inside a long
|
static boolean |
isByteArrayDecimalType(DataType dt)
Returns if dt is a DecimalType that doesn't fit inside a long
|
static String |
json() |
static int |
MAX_PRECISION() |
static int |
MAX_SCALE() |
static int |
MINIMUM_ADJUSTED_SCALE() |
int |
precision() |
static String |
prettyJson() |
abstract static int |
productArity() |
abstract static Object |
productElement(int n) |
static scala.collection.Iterator<Object> |
productIterator() |
static String |
productPrefix() |
int |
scale() |
String |
simpleString() |
String |
sql() |
static DecimalType |
SYSTEM_DEFAULT() |
String |
toString() |
String |
typeName() |
static boolean |
unapply(DataType t) |
static boolean |
unapply(org.apache.spark.sql.catalyst.expressions.Expression e) |
static DecimalType |
USER_DEFAULT() |
canWrite, catalogString, equalsStructurally, fromDDL, fromJson, json, prettyJson
public DecimalType(int precision, int scale)
public DecimalType(int precision)
public DecimalType()
public static int MAX_PRECISION()
public static int MAX_SCALE()
public static DecimalType SYSTEM_DEFAULT()
public static DecimalType USER_DEFAULT()
public static int MINIMUM_ADJUSTED_SCALE()
public static boolean is32BitDecimalType(DataType dt)
dt
- (undocumented)public static boolean is64BitDecimalType(DataType dt)
dt
- (undocumented)public static boolean isByteArrayDecimalType(DataType dt)
dt
- (undocumented)public static boolean unapply(DataType t)
public static boolean unapply(org.apache.spark.sql.catalyst.expressions.Expression e)
public static String json()
public static String prettyJson()
public static String catalogString()
public abstract static boolean canEqual(Object that)
public abstract static boolean equals(Object that)
public abstract static Object productElement(int n)
public abstract static int productArity()
public static scala.collection.Iterator<Object> productIterator()
public static String productPrefix()
public int precision()
public int scale()
public String typeName()
public String toString()
toString
in class Object
public String sql()
public int defaultSize()
public String simpleString()