| Package | Description |
|---|---|
| org.apache.hadoop.hive.common.type | |
| org.apache.hadoop.hive.ql.exec.vector | |
| org.apache.hadoop.hive.ql.util | |
| org.apache.hadoop.hive.serde2.io |
| Modifier and Type | Field and Description |
|---|---|
static HiveDecimal |
HiveDecimal.ONE |
static HiveDecimal |
HiveDecimal.ZERO
Common values.
|
| Modifier and Type | Method and Description |
|---|---|
HiveDecimal |
HiveDecimal.abs()
Take the absolute value of a decimal.
|
HiveDecimal |
HiveDecimal.add(HiveDecimal dec)
Add the current decimal and another decimal and return the result.
|
static HiveDecimal |
HiveDecimal.create(BigDecimal bigDecimal)
Create a HiveDecimal from BigDecimal object.
|
static HiveDecimal |
HiveDecimal.create(BigDecimal bigDecimal,
boolean allowRounding)
Same as the above create method, except fractional digit rounding can be turned off.
|
static HiveDecimal |
HiveDecimal.create(BigInteger bigInteger)
Creates a HiveDecimal from a BigInteger's value with a scale of 0.
|
static HiveDecimal |
HiveDecimal.create(BigInteger bigInteger,
int scale)
Creates a HiveDecimal from a BigInteger's value with a specified scale.
|
static HiveDecimal |
HiveDecimal.create(boolean isNegative,
byte[] bytes,
int scale)
This method takes in digits only UTF-8 characters, a sign flag, and a scale and returns
a decimal.
|
static HiveDecimal |
HiveDecimal.create(boolean isNegative,
byte[] bytes,
int offset,
int length,
int scale) |
static HiveDecimal |
HiveDecimal.create(byte[] bytes)
Create a HiveDecimal by parsing the characters in a whole byte array.
|
static HiveDecimal |
HiveDecimal.create(byte[] bytes,
boolean trimBlanks)
Same as the method above, except blanks before and after are tolerated.
|
static HiveDecimal |
HiveDecimal.create(byte[] bytes,
int offset,
int length)
Create a HiveDecimal by parsing the characters in a slice of a byte array.
|
static HiveDecimal |
HiveDecimal.create(byte[] bytes,
int offset,
int length,
boolean trimBlanks)
Same as the method above, except blanks before and after are tolerated.
|
static HiveDecimal |
HiveDecimal.create(double doubleValue)
Create a HiveDecimal object from a double.
|
static HiveDecimal |
HiveDecimal.create(float floatValue)
Create a HiveDecimal object from a float.
|
static HiveDecimal |
HiveDecimal.create(int intValue)
Create a HiveDecimal object from an int.
|
static HiveDecimal |
HiveDecimal.create(long longValue)
Create a HiveDecimal object from a long.
|
static HiveDecimal |
HiveDecimal.create(long longValue,
int scale)
Create a HiveDecimal object from a long with a specified scale.
|
static HiveDecimal |
HiveDecimal.create(String string)
Create a HiveDecimal by parsing a whole string.
|
static HiveDecimal |
HiveDecimal.create(String string,
boolean trimBlanks)
Same as the method above, except blanks before and after are tolerated.
|
static HiveDecimal |
HiveDecimal.createFromBigIntegerBytesAndScale(byte[] bytes,
int scale)
Convert bytes in the format used by BigInteger's toByteArray format (and accepted by its
constructor) into a decimal using the specified scale.
|
static HiveDecimal |
HiveDecimal.createFromBigIntegerBytesAndScale(byte[] bytes,
int offset,
int length,
int scale) |
static HiveDecimal |
HiveDecimal.createFromFast(FastHiveDecimal fastDec)
Create a HiveDecimal from a FastHiveDecimal object.
|
HiveDecimal |
HiveDecimal.divide(HiveDecimal divisor)
Divides this decimal by another decimal and returns a new decimal with the result.
|
static HiveDecimal |
HiveDecimal.enforcePrecisionScale(HiveDecimal dec,
int maxPrecision,
int maxScale)
Determine if a decimal fits within a specified maxPrecision and maxScale, and round
off fractional digits if necessary to make the decimal fit.
|
HiveDecimal |
HiveDecimal.fractionPortion()
Return a decimal with only the fractional digits.
|
static HiveDecimal |
RandomTypeUtil.getRandHiveDecimal(Random r) |
HiveDecimal |
HiveDecimal.integerPortion()
Return a decimal with only the integer digits.
|
HiveDecimal |
HiveDecimal.multiply(HiveDecimal dec)
Multiply two decimals.
|
HiveDecimal |
HiveDecimal.negate()
Reverse the sign of a decimal.
|
HiveDecimal |
HiveDecimal.pow(int exponent)
Return the result of decimal^exponent
|
HiveDecimal |
HiveDecimal.remainder(HiveDecimal divisor)
Divides this decimal by another decimal and returns a new decimal with the remainder of the
division.
|
HiveDecimal |
HiveDecimal.scaleByPowerOfTen(int power)
Multiplies a decimal by a power of 10.
|
static HiveDecimal |
HiveDecimal.serializationUtilsRead(InputStream inputStream,
int scale,
byte[] scratchBytes)
Deserialize data written in the format used by the SerializationUtils methods
readBigInteger/writeBigInteger and create a decimal using the supplied scale.
|
HiveDecimal |
HiveDecimal.setScale(int serializationScale)
Deprecated.
|
HiveDecimal |
HiveDecimal.setScale(int roundingPoint,
int roundingMode)
Do decimal rounding and return the result.
|
HiveDecimal |
HiveDecimal.subtract(HiveDecimal dec)
Subtract from the current decimal another decimal and return the result.
|
| Modifier and Type | Method and Description |
|---|---|
HiveDecimal |
HiveDecimal.add(HiveDecimal dec)
Add the current decimal and another decimal and return the result.
|
int |
HiveDecimal.compareTo(HiveDecimal dec) |
HiveDecimal |
HiveDecimal.divide(HiveDecimal divisor)
Divides this decimal by another decimal and returns a new decimal with the result.
|
static HiveDecimal |
HiveDecimal.enforcePrecisionScale(HiveDecimal dec,
int maxPrecision,
int maxScale)
Determine if a decimal fits within a specified maxPrecision and maxScale, and round
off fractional digits if necessary to make the decimal fit.
|
HiveDecimal |
HiveDecimal.multiply(HiveDecimal dec)
Multiply two decimals.
|
HiveDecimal |
HiveDecimal.remainder(HiveDecimal divisor)
Divides this decimal by another decimal and returns a new decimal with the remainder of the
division.
|
HiveDecimal |
HiveDecimal.subtract(HiveDecimal dec)
Subtract from the current decimal another decimal and return the result.
|
| Modifier and Type | Method and Description |
|---|---|
void |
DecimalColumnVector.fill(HiveDecimal value) |
void |
Decimal64ColumnVector.set(int elementNum,
HiveDecimal hiveDec)
Set a Decimal64 field from a HiveDecimal.
|
void |
DecimalColumnVector.set(int elementNum,
HiveDecimal hiveDec)
Set a decimal from a HiveDecimal.
|
| Modifier and Type | Method and Description |
|---|---|
static Timestamp |
TimestampUtils.decimalToTimestamp(HiveDecimal dec)
Take a HiveDecimal and return the timestamp representation where the fraction part is the
nanoseconds and integer part is the number of seconds.
|
| Modifier and Type | Method and Description |
|---|---|
HiveDecimal |
HiveDecimalWritable.getHiveDecimal()
Returns a HiveDecimal for the writable's current value.
|
HiveDecimal |
HiveDecimalWritable.getHiveDecimal(int maxPrecision,
int maxScale)
Get a HiveDecimal instance from the writable and constraint it with maximum precision/scale.
|
| Modifier and Type | Method and Description |
|---|---|
int |
HiveDecimalWritable.compareTo(HiveDecimal dec) |
static int |
HiveDecimalWritable.compareTo(HiveDecimal dec,
HiveDecimalWritable writable) |
void |
HiveDecimalWritable.mutateAdd(HiveDecimal dec) |
void |
HiveDecimalWritable.mutateDivide(HiveDecimal dec) |
void |
HiveDecimalWritable.mutateMultiply(HiveDecimal dec) |
void |
HiveDecimalWritable.mutateRemainder(HiveDecimal dec) |
void |
HiveDecimalWritable.mutateSubtract(HiveDecimal dec) |
void |
HiveDecimalWritable.set(HiveDecimal value)
Set the writable's current value to a HiveDecimal's value.
|
void |
HiveDecimalWritable.set(HiveDecimal value,
int maxPrecision,
int maxScale)
Set the writable's current value to a HiveDecimal's value with a specified precision / scale
enforced.
|
| Constructor and Description |
|---|
HiveDecimalWritable(HiveDecimal value)
Create a decimal writable with an initial value from a HiveDecimal.
|
Copyright © 2021 The Apache Software Foundation. All rights reserved.