public final class HiveDecimalV1 extends Object implements Comparable<HiveDecimalV1>
Modifier and Type | Field and Description |
---|---|
static int |
MAX_PRECISION |
static int |
MAX_SCALE |
static HiveDecimalV1 |
ONE |
static int |
ROUND_CEILING |
static int |
ROUND_FLOOR |
static int |
ROUND_HALF_EVEN |
static int |
ROUND_HALF_UP |
static int |
SYSTEM_DEFAULT_PRECISION
Default precision/scale when system is not able to determine them, such as in case
of a non-generic udf.
|
static int |
SYSTEM_DEFAULT_SCALE |
static int |
USER_DEFAULT_PRECISION
Default precision/scale when user doesn't specify in the column metadata, such as
decimal and decimal(8).
|
static int |
USER_DEFAULT_SCALE |
static HiveDecimalV1 |
ZERO |
Modifier and Type | Method and Description |
---|---|
HiveDecimalV1 |
abs() |
HiveDecimalV1 |
add(HiveDecimalV1 dec) |
BigDecimal |
bigDecimalValue() |
byte |
byteValue() |
int |
compareTo(HiveDecimalV1 dec) |
static HiveDecimalV1 |
create(BigDecimal b) |
static HiveDecimalV1 |
create(BigDecimal b,
boolean allowRounding) |
static HiveDecimalV1 |
create(BigInteger bi) |
static HiveDecimalV1 |
create(BigInteger unscaled,
int scale) |
static HiveDecimalV1 |
create(int i) |
static HiveDecimalV1 |
create(long l) |
static HiveDecimalV1 |
create(String dec) |
HiveDecimalV1 |
divide(HiveDecimalV1 dec) |
double |
doubleValue() |
static HiveDecimalV1 |
enforcePrecisionScale(HiveDecimalV1 dec,
int maxPrecision,
int maxScale) |
boolean |
equals(Object obj) |
float |
floatValue() |
int |
hashCode() |
int |
intValue()
Note - this method will corrupt the value if it doesn't fit.
|
long |
longValue()
Note - this method will corrupt the value if it doesn't fit.
|
long |
longValueExact() |
HiveDecimalV1 |
multiply(HiveDecimalV1 dec) |
HiveDecimalV1 |
negate() |
HiveDecimalV1 |
pow(int n) |
int |
precision()
Returns the number of digits (integer and fractional) in the number, which is equivalent
to SQL decimal precision.
|
HiveDecimalV1 |
remainder(HiveDecimalV1 dec) |
int |
scale() |
HiveDecimalV1 |
scaleByPowerOfTen(int n) |
HiveDecimalV1 |
setScale(int i) |
HiveDecimalV1 |
setScale(int adjustedScale,
int rm) |
short |
shortValue()
Note - this method will corrupt the value if it doesn't fit.
|
int |
signum()
Get the sign of the underlying decimal.
|
HiveDecimalV1 |
subtract(HiveDecimalV1 dec) |
String |
toFormatString(int scale)
Return a string representation of the number with the number of decimal digits as
the given scale.
|
String |
toString() |
BigInteger |
unscaledValue() |
@HiveDecimalVersionV1 public static final int MAX_PRECISION
@HiveDecimalVersionV1 public static final int MAX_SCALE
@HiveDecimalVersionV1 public static final int USER_DEFAULT_PRECISION
@HiveDecimalVersionV1 public static final int USER_DEFAULT_SCALE
@HiveDecimalVersionV1 public static final int SYSTEM_DEFAULT_PRECISION
@HiveDecimalVersionV1 public static final int SYSTEM_DEFAULT_SCALE
@HiveDecimalVersionV1 public static final HiveDecimalV1 ZERO
@HiveDecimalVersionV1 public static final HiveDecimalV1 ONE
@HiveDecimalVersionV1 public static final int ROUND_FLOOR
@HiveDecimalVersionV1 public static final int ROUND_CEILING
@HiveDecimalVersionV1 public static final int ROUND_HALF_UP
@HiveDecimalVersionV1 public static final int ROUND_HALF_EVEN
@HiveDecimalVersionV1 public static HiveDecimalV1 create(BigDecimal b)
@HiveDecimalVersionV1 public static HiveDecimalV1 create(BigDecimal b, boolean allowRounding)
@HiveDecimalVersionV1 public static HiveDecimalV1 create(BigInteger unscaled, int scale)
@HiveDecimalVersionV1 public static HiveDecimalV1 create(String dec)
@HiveDecimalVersionV1 public static HiveDecimalV1 create(BigInteger bi)
@HiveDecimalVersionV1 public static HiveDecimalV1 create(int i)
@HiveDecimalVersionV1 public static HiveDecimalV1 create(long l)
@HiveDecimalVersionV1 public String toString()
@HiveDecimalVersionV1 public String toFormatString(int scale)
scale
- the number of digits after the decimal point@HiveDecimalVersionV1 public HiveDecimalV1 setScale(int i)
@HiveDecimalVersionV1 public int compareTo(HiveDecimalV1 dec)
compareTo
in interface Comparable<HiveDecimalV1>
@HiveDecimalVersionV1 public int hashCode()
@HiveDecimalVersionV1 public boolean equals(Object obj)
@HiveDecimalVersionV1 public int scale()
@HiveDecimalVersionV1 public int precision()
@HiveDecimalVersionV1 public int intValue()
@HiveDecimalVersionV1 public double doubleValue()
@HiveDecimalVersionV1 public long longValue()
@HiveDecimalVersionV1 public short shortValue()
@HiveDecimalVersionV1 public float floatValue()
@HiveDecimalVersionV1 public BigDecimal bigDecimalValue()
@HiveDecimalVersionV1 public byte byteValue()
@HiveDecimalVersionV1 public HiveDecimalV1 setScale(int adjustedScale, int rm)
@HiveDecimalVersionV1 public HiveDecimalV1 subtract(HiveDecimalV1 dec)
@HiveDecimalVersionV1 public HiveDecimalV1 multiply(HiveDecimalV1 dec)
@HiveDecimalVersionV1 public BigInteger unscaledValue()
@HiveDecimalVersionV1 public HiveDecimalV1 scaleByPowerOfTen(int n)
@HiveDecimalVersionV1 public HiveDecimalV1 abs()
@HiveDecimalVersionV1 public HiveDecimalV1 negate()
@HiveDecimalVersionV1 public HiveDecimalV1 add(HiveDecimalV1 dec)
@HiveDecimalVersionV1 public HiveDecimalV1 pow(int n)
@HiveDecimalVersionV1 public HiveDecimalV1 remainder(HiveDecimalV1 dec)
@HiveDecimalVersionV1 public HiveDecimalV1 divide(HiveDecimalV1 dec)
@HiveDecimalVersionV1 public int signum()
@HiveDecimalVersionV1 public static HiveDecimalV1 enforcePrecisionScale(HiveDecimalV1 dec, int maxPrecision, int maxScale)
@HiveDecimalVersionV1 public long longValueExact()
Copyright © 2021 The Apache Software Foundation. All rights reserved.