public class HiveDecimal extends Object implements Comparable<HiveDecimal>
Modifier and Type | Field and Description |
---|---|
static int |
MAX_PRECISION |
static int |
MAX_SCALE |
static HiveDecimal |
ONE |
static int |
ROUND_CEILING |
static int |
ROUND_FLOOR |
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 HiveDecimal |
ZERO |
public static final int MAX_PRECISION
public static final int MAX_SCALE
public static final int USER_DEFAULT_PRECISION
public static final int USER_DEFAULT_SCALE
public static final int SYSTEM_DEFAULT_PRECISION
public static final int SYSTEM_DEFAULT_SCALE
public static final HiveDecimal ZERO
public static final HiveDecimal ONE
public static final int ROUND_FLOOR
public static final int ROUND_CEILING
public static final int ROUND_HALF_UP
public static HiveDecimal create(BigDecimal b)
public static HiveDecimal create(BigDecimal b, boolean allowRounding)
public static HiveDecimal create(BigInteger unscaled, int scale)
public static HiveDecimal create(String dec)
public static HiveDecimal create(BigInteger bi)
public static HiveDecimal create(int i)
public static HiveDecimal create(long l)
public HiveDecimal setScale(int i)
public int compareTo(HiveDecimal dec)
compareTo
in interface Comparable<HiveDecimal>
public int scale()
public int precision()
public int intValue()
public double doubleValue()
public long longValue()
public short shortValue()
public float floatValue()
public BigDecimal bigDecimalValue()
public byte byteValue()
public HiveDecimal setScale(int adjustedScale, int rm)
public HiveDecimal subtract(HiveDecimal dec)
public HiveDecimal multiply(HiveDecimal dec)
public BigInteger unscaledValue()
public HiveDecimal scaleByPowerOfTen(int n)
public HiveDecimal abs()
public HiveDecimal negate()
public HiveDecimal add(HiveDecimal dec)
public HiveDecimal pow(int n)
public HiveDecimal remainder(HiveDecimal dec)
public HiveDecimal divide(HiveDecimal dec)
public int signum()
public static BigDecimal enforcePrecisionScale(BigDecimal bd, int maxPrecision, int maxScale)
public static HiveDecimal enforcePrecisionScale(HiveDecimal dec, int maxPrecision, int maxScale)
Copyright © 2017 The Apache Software Foundation. All rights reserved.