| Package | Description |
|---|---|
| org.apache.hadoop.hive.common.type |
| Modifier and Type | Field and Description |
|---|---|
static int |
HiveDecimal.SCRATCH_BUFFER_LEN_BIG_INTEGER_BYTES |
static int |
HiveDecimal.SCRATCH_BUFFER_LEN_SERIALIZATION_UTILS_READ |
static int |
HiveDecimal.SCRATCH_BUFFER_LEN_TO_BYTES |
static int |
HiveDecimal.SCRATCH_LONGS_LEN |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
HiveDecimal.bigIntegerBytes() |
int |
HiveDecimal.bigIntegerBytes(long[] scratchLongs,
byte[] buffer)
Return binary representation of this decimal's BigInteger equivalent unscaled value using
the format that the BigInteger's toByteArray method returns (and the BigInteger constructor
accepts).
|
byte[] |
HiveDecimal.bigIntegerBytesScaled(int serializeScale) |
int |
HiveDecimal.bigIntegerBytesScaled(int serializeScale,
long[] scratchLongs,
byte[] buffer)
Convert decimal to BigInteger binary bytes with a serialize scale, similar to the formatScale
for toFormatString.
|
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(long longValue,
int scale)
Create a HiveDecimal object from a long with a specified scale.
|
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.fractionPortion()
Return a decimal with only the fractional digits.
|
int |
HiveDecimal.integerDigitCount()
Returns the number of integer digits in the decimal.
|
HiveDecimal |
HiveDecimal.integerPortion()
Return a decimal with only the integer digits.
|
boolean |
HiveDecimal.isByte()
Is the decimal value a byte? Range -128 to 127.
|
boolean |
HiveDecimal.isInt()
Is the decimal value a int? Range -2,147,483,648 to 2,147,483,647.
|
boolean |
HiveDecimal.isLong()
Is the decimal value a long? Range -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
|
boolean |
HiveDecimal.isShort()
Is the decimal value a short? Range -32,768 to 32,767.
|
int |
HiveDecimal.newFasterHashCode()
Hash code based on (new) decimal representation.
|
int |
HiveDecimal.rawPrecision() |
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.
|
boolean |
HiveDecimal.serializationUtilsWrite(OutputStream outputStream,
long[] scratchLongs)
Serialize this decimal's BigInteger equivalent unscaled value using the format that the
SerializationUtils methods readBigInteger/writeBigInteger use.
|
int |
HiveDecimal.toBytes(byte[] scratchBuffer)
Decimal to ASCII bytes conversion.
|
int |
HiveDecimal.toDigitsOnlyBytes(byte[] scratchBuffer)
Convert decimal to just the digits -- no dot.
|
String |
HiveDecimal.toDigitsOnlyString() |
int |
HiveDecimal.toFormatBytes(int formatScale,
byte[] scratchBuffer)
This is the serialization version of decimal to string conversion.
|
String |
HiveDecimal.toFormatString(int formatScale,
byte[] scratchBuffer) |
String |
HiveDecimal.toString(byte[] scratchBuffer) |
void |
HiveDecimal.validate()
Throws an exception if the current decimal value is invalid.
|
Copyright © 2020 The Apache Software Foundation. All rights reserved.