Package | Description |
---|---|
org.apache.hadoop.hive.common.type | |
org.apache.hadoop.hive.serde2.io |
Modifier and Type | Class and Description |
---|---|
class |
FastHiveDecimalImpl
This class is a companion to the FastHiveDecimal class that separates the essential of code
out of FastHiveDecimal into static methods in this class so that they can be used directly
by vectorization to implement decimals by storing the fast0, fast1, and fast2 longs and
the fastSignum, fastScale, etc ints in the DecimalColumnVector class.
|
class |
HiveDecimal
HiveDecimal is a decimal data type with a maximum precision and scale.
|
Modifier and Type | Method and Description |
---|---|
static HiveDecimal |
HiveDecimal.createFromFast(FastHiveDecimal fastDec)
Create a HiveDecimal from a FastHiveDecimal object.
|
static boolean |
FastHiveDecimalImpl.doAddSameScaleSameSign(FastHiveDecimal fastLeft,
FastHiveDecimal fastRight,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.doAddSameScaleSameSign(int resultSignum,
long left0,
long left1,
long left2,
long right0,
long right1,
long right2,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.doBinaryToDecimalConversion(long lowerWord,
long middleWord,
long highWord,
FastHiveDecimal middleWordMultiplier,
FastHiveDecimal highWordMultiplier,
FastHiveDecimal fastResult)
Convert 3 binary words of N bits each to a fast decimal (scale 0).
|
static boolean |
FastHiveDecimalImpl.doDecimalToBinaryDivisionRemainder(long dividendFast0,
long dividendFast1,
long dividendFast2,
FastHiveDecimal fastInverseConst,
int quotientIntegerWordNum,
int quotientIntegerDigitNum,
FastHiveDecimal fastMultiplierConst,
long[] scratchLongs)
A helper method that produces a single binary word remainder from a fast decimal (and
quotient).
|
static boolean |
FastHiveDecimalImpl.doFastRound(int fastSignum,
long fast0,
long fast1,
long fast2,
int fastIntegerDigitCount,
int fastScale,
int roundPower,
int roundingMode,
FastHiveDecimal fastResult) |
static void |
FastHiveDecimalImpl.doFastScaleDown(FastHiveDecimal fastDec,
int scaleDown,
FastHiveDecimal fastResult) |
static void |
FastHiveDecimalImpl.doFastScaleDown(long fast0,
long fast1,
long fast2,
int scaleDown,
FastHiveDecimal fastResult)
Fast decimal scale down by factor of 10 with NO rounding.
|
static boolean |
FastHiveDecimalImpl.doSubtractSameScaleNoUnderflow(int resultSignum,
FastHiveDecimal fastLeft,
FastHiveDecimal fastRight,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.doSubtractSameScaleNoUnderflow(int resultSignum,
long left0,
long left1,
long left2,
long right0,
long right1,
long right2,
FastHiveDecimal fastResult) |
protected boolean |
FastHiveDecimal.fastAdd(FastHiveDecimal fastRight,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.fastAdd(FastHiveDecimal fastLeft,
FastHiveDecimal fastRight,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.fastAdd(int leftSignum,
long leftFast0,
long leftFast1,
long leftFast2,
int leftIntegerDigitCount,
int leftScale,
int rightSignum,
long rightFast0,
long rightFast1,
long rightFast2,
int rightIntegerDigitCount,
int rightScale,
FastHiveDecimal fastResult)
Add the two decimals.
|
protected int |
FastHiveDecimal.fastCompareTo(FastHiveDecimal right) |
protected static int |
FastHiveDecimal.fastCompareTo(FastHiveDecimal left,
FastHiveDecimal right) |
static int |
FastHiveDecimalImpl.fastCompareTo(int leftSignum,
long leftFast0,
long leftFast1,
long leftFast2,
int leftScale,
FastHiveDecimal fastRight) |
static void |
FastHiveDecimalImpl.fastDeserialize64(long inputDecimal64Long,
int inputScale,
FastHiveDecimal fastResult) |
protected boolean |
FastHiveDecimal.fastDivide(FastHiveDecimal fastRight,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.fastDivide(FastHiveDecimal fastLeft,
FastHiveDecimal fastRight,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.fastDivide(int leftSignum,
long leftFast0,
long leftFast1,
long leftFast2,
int leftIntegerDigitCount,
int leftScale,
int rightSignum,
long rightFast0,
long rightFast1,
long rightFast2,
int rightIntegerDigitCount,
int rightScale,
FastHiveDecimal fastResult) |
protected boolean |
FastHiveDecimal.fastEquals(FastHiveDecimal that) |
static boolean |
FastHiveDecimalImpl.fastEquals(int leftSignum,
long leftFast0,
long leftFast1,
long leftFast2,
int leftScale,
FastHiveDecimal fastRight) |
static void |
FastHiveDecimalImpl.fastFractionPortion(int fastSignum,
long fast0,
long fast1,
long fast2,
int fastScale,
FastHiveDecimal fastResult)
Creates fast decimal from the fraction portion of a fast decimal.
|
static void |
FastHiveDecimalImpl.fastIntegerPortion(int fastSignum,
long fast0,
long fast1,
long fast2,
int fastIntegerDigitCount,
int fastScale,
FastHiveDecimal fastResult)
Creates fast decimal from the integer portion.
|
static boolean |
FastHiveDecimalImpl.fastIsValid(FastHiveDecimal fastDec) |
protected boolean |
FastHiveDecimal.fastMultiply(FastHiveDecimal fastRight,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.fastMultiply(FastHiveDecimal fastLeft,
FastHiveDecimal fastRight,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.fastMultiply(int leftSignum,
long leftFast0,
long leftFast1,
long leftFast2,
int leftIntegerDigitCount,
int leftScale,
int rightSignum,
long rightFast0,
long rightFast1,
long rightFast2,
int rightIntegerDigitCount,
int rightScale,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.fastMultiply5x5HalfWords(FastHiveDecimal fastLeft,
FastHiveDecimal fastRight,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.fastMultiply5x5HalfWords(long left0,
long left1,
long left2,
long right0,
long right1,
long right2,
FastHiveDecimal fastResult)
Fast decimal multiplication on two decimals that have been already scaled and whose results
will fit in 38 digits.
|
static boolean |
FastHiveDecimalImpl.fastMultiplyFullInternal(FastHiveDecimal fastLeft,
FastHiveDecimal fastRight,
long[] result) |
protected boolean |
FastHiveDecimal.fastPow(int exponent,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.fastPow(int fastSignum,
long fast0,
long fast1,
long fast2,
int fastIntegerDigitCount,
int fastScale,
int exponent,
FastHiveDecimal fastResult) |
static void |
FastHiveDecimalImpl.fastRaiseInvalidException(FastHiveDecimal fastResult) |
static void |
FastHiveDecimalImpl.fastRaiseInvalidException(FastHiveDecimal fastResult,
String parameters) |
static int |
FastHiveDecimalImpl.fastRawPrecision(FastHiveDecimal fastDec) |
protected boolean |
FastHiveDecimal.fastRemainder(FastHiveDecimal fastRight,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.fastRemainder(int leftSignum,
long leftFast0,
long leftFast1,
long leftFast2,
int leftIntegerDigitCount,
int leftScale,
int rightSignum,
long rightFast0,
long rightFast1,
long rightFast2,
int rightIntegerDigitCount,
int rightScale,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.fastRound(FastHiveDecimal fastDec,
int newScale,
int roundingMode,
FastHiveDecimal fastResult) |
protected boolean |
FastHiveDecimal.fastRound(int newScale,
int roundingMode,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.fastRound(int fastSignum,
long fast0,
long fast1,
long fast2,
int fastIntegerDigitCount,
int fastScale,
int newScale,
int roundingMode,
FastHiveDecimal fastResult) |
static void |
FastHiveDecimalImpl.fastRoundFractionalDown(int fastSignum,
long fast0,
long fast1,
long fast2,
int scaleDown,
FastHiveDecimal fastResult)
Fast decimal scale down by factor of 10 with rounding ROUND_DOWN.
|
static boolean |
FastHiveDecimalImpl.fastRoundFractionalHalfEven(int fastSignum,
long fast0,
long fast1,
long fast2,
int scaleDown,
FastHiveDecimal fastResult)
Fast decimal scale down by factor of 10 with rounding ROUND_HALF_EVEN.
|
static boolean |
FastHiveDecimalImpl.fastRoundFractionalHalfUp(int fastSignum,
long fast0,
long fast1,
long fast2,
int scaleDown,
FastHiveDecimal fastResult)
Fast decimal scale down by factor of 10 with rounding ROUND_HALF_UP.
|
static boolean |
FastHiveDecimalImpl.fastRoundFractionalHalfUp5Words(int fastSignum,
long fast0,
long fast1,
long fast2,
long fast3,
long fast4,
int scaleDown,
FastHiveDecimal fastResult)
Fast decimal scale down by factor of 10 with rounding ROUND_HALF_UP.
|
static boolean |
FastHiveDecimalImpl.fastRoundFractionalUp(int fastSignum,
long fast0,
long fast1,
long fast2,
int scaleDown,
FastHiveDecimal fastResult)
Fast decimal scale down by factor of 10 with rounding ROUND_UP.
|
static boolean |
FastHiveDecimalImpl.fastRoundIntegerDown(int fastSignum,
long fast0,
long fast1,
long fast2,
int fastIntegerDigitCount,
int fastScale,
int roundPower,
FastHiveDecimal fastResult)
Fast decimal scale down by factor of 10 with rounding ROUND_DOWN.
|
static boolean |
FastHiveDecimalImpl.fastRoundIntegerHalfEven(int fastSignum,
long fast0,
long fast1,
long fast2,
int fastIntegerDigitCount,
int fastScale,
int roundPower,
FastHiveDecimal fastResult)
Fast decimal scale down by factor of 10 with rounding ROUND_HALF_EVEN.
|
static boolean |
FastHiveDecimalImpl.fastRoundIntegerHalfUp(int fastSignum,
long fast0,
long fast1,
long fast2,
int fastIntegerDigitCount,
int fastScale,
int roundPower,
FastHiveDecimal fastResult)
Fast decimal scale down by factor of 10 with rounding ROUND_HALF_UP.
|
static boolean |
FastHiveDecimalImpl.fastRoundIntegerUp(int fastSignum,
long fast0,
long fast1,
long fast2,
int fastIntegerDigitCount,
int fastScale,
int roundPower,
FastHiveDecimal fastResult)
Fast decimal integer part rounding ROUND_UP.
|
static boolean |
FastHiveDecimalImpl.fastScaleByPowerOfTen(FastHiveDecimal fastDec,
int power,
FastHiveDecimal fastResult) |
protected boolean |
FastHiveDecimal.fastScaleByPowerOfTen(int n,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.fastScaleByPowerOfTen(int fastSignum,
long fast0,
long fast1,
long fast2,
int fastIntegerDigitCount,
int fastScale,
int power,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.fastScaleDownNoRound(int fastSignum,
long fast0,
long fast1,
long fast2,
int scaleDown,
FastHiveDecimal fastResult)
Fast decimal scale down by factor of 10 and do not allow rounding.
|
static boolean |
FastHiveDecimalImpl.fastScaleUp(FastHiveDecimal fastDec,
int scaleUp,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.fastScaleUp(long fast0,
long fast1,
long fast2,
int scaleUp,
FastHiveDecimal fastResult)
Fast decimal scale up by factor of 10.
|
static boolean |
FastHiveDecimalImpl.fastSerializationUtilsRead(InputStream inputStream,
int scale,
byte[] scratchBytes,
FastHiveDecimal fastResult)
Deserialize data written in the format used by the SerializationUtils methods
readBigInteger/writeBigInteger and create a decimal using the supplied scale.
|
protected void |
FastHiveDecimal.fastSet(FastHiveDecimal fastDec) |
static boolean |
FastHiveDecimalImpl.fastSetFromBigDecimal(BigDecimal bigDecimal,
boolean allowRounding,
FastHiveDecimal fastResult)
Create a fast decimal from a BigDecimal.
|
static boolean |
FastHiveDecimalImpl.fastSetFromBigInteger(BigInteger bigInteger,
FastHiveDecimal fastResult)
Creates a fast decimal from a BigInteger with scale 0.
|
static boolean |
FastHiveDecimalImpl.fastSetFromBigInteger(BigInteger bigInteger,
int scale,
FastHiveDecimal fastResult)
Creates a fast decimal from a BigInteger with a specified scale.
|
static boolean |
FastHiveDecimalImpl.fastSetFromBigInteger(BigInteger bigInteger,
int scale,
int precision,
FastHiveDecimal fastResult)
Creates a fast decimal from a BigInteger with a specified scale.
|
static boolean |
FastHiveDecimalImpl.fastSetFromBigIntegerBytesAndScale(byte[] bytes,
int offset,
int length,
int scale,
FastHiveDecimal fastResult)
Convert bytes in the format used by BigInteger's toByteArray format (and accepted by its
constructor) into a decimal using the specified scale.
|
static boolean |
FastHiveDecimalImpl.fastSetFromBytes(byte[] bytes,
int offset,
int length,
boolean trimBlanks,
FastHiveDecimal fastResult)
Scan a byte array slice for a decimal number in UTF-8 bytes.
|
static boolean |
FastHiveDecimalImpl.fastSetFromDigitsOnlyBytesAndScale(boolean isNegative,
byte[] bytes,
int offset,
int length,
int scale,
FastHiveDecimal fastResult)
Scans a byte array slice for UNSIGNED RAW DIGITS ONLY in UTF-8 (ASCII) characters
and forms a decimal from the digits and a sign and scale.
|
static boolean |
FastHiveDecimalImpl.fastSetFromDouble(double doubleValue,
FastHiveDecimal fastResult)
Creates fast decimal from a double.
|
static boolean |
FastHiveDecimalImpl.fastSetFromFloat(float floatValue,
FastHiveDecimal fastResult)
Creates fast decimal from a float.
|
static void |
FastHiveDecimalImpl.fastSetFromInt(int intValue,
FastHiveDecimal fastResult)
Creates a scale 0 fast decimal from an int.
|
static void |
FastHiveDecimalImpl.fastSetFromLong(long longValue,
FastHiveDecimal fastResult)
Creates a scale 0 fast decimal from a long.
|
static boolean |
FastHiveDecimalImpl.fastSetFromLongAndScale(long longValue,
int scale,
FastHiveDecimal fastResult)
Creates a fast decimal from a long with a specified scale.
|
static boolean |
FastHiveDecimalImpl.fastSetFromString(String string,
boolean trimBlanks,
FastHiveDecimal result)
Scan a String for a decimal number in UTF-8 characters.
|
static int |
FastHiveDecimalImpl.fastSqlPrecision(FastHiveDecimal fastDec) |
protected boolean |
FastHiveDecimal.fastSubtract(FastHiveDecimal fastRight,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.fastSubtract(FastHiveDecimal fastLeft,
FastHiveDecimal fastRight,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.fastSubtract(int leftSignum,
long leftFast0,
long leftFast1,
long leftFast2,
int leftIntegerDigitCount,
int leftScale,
int rightSignum,
long rightFast0,
long rightFast1,
long rightFast2,
int rightIntegerDigitCount,
int rightScale,
FastHiveDecimal fastResult) |
protected boolean |
FastHiveDecimal.fastUpdatePrecisionScale(int maxPrecision,
int maxScale,
FastHiveDecimal.FastCheckPrecisionScaleStatus status,
FastHiveDecimal fastResult) |
static boolean |
FastHiveDecimalImpl.fastUpdatePrecisionScale(int fastSignum,
long fast0,
long fast1,
long fast2,
int fastIntegerDigitCount,
int fastScale,
int maxPrecision,
int maxScale,
FastHiveDecimal.FastCheckPrecisionScaleStatus status,
FastHiveDecimal fastResult) |
Constructor and Description |
---|
FastHiveDecimal(FastHiveDecimal fastDec) |
FastHiveDecimal(int fastSignum,
FastHiveDecimal fastDec) |
Modifier and Type | Class and Description |
---|---|
class |
HiveDecimalWritable
A mutable decimal.
|
Copyright © 2021 The Apache Software Foundation. All rights reserved.