Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <decimal-util.h>
Public Member Functions | |
template<> | |
int32_t | GetScaleMultiplier (int scale) |
template<> | |
int64_t | GetScaleMultiplier (int scale) |
template<> | |
int128_t | GetScaleMultiplier (int scale) |
Static Public Member Functions | |
static void | InitMaxUnscaledDecimal () |
Initializes MAX_UNSCALED_DECIMAL. Must be called once before using it. More... | |
template<typename T > | |
static T | MultiplyByScale (const T &v, const ColumnType &t) |
TODO: do we need to handle overflow here or at a higher abstraction. More... | |
template<typename T > | |
static T | MultiplyByScale (const T &v, int scale) |
template<typename T > | |
static T | GetScaleMultiplier (int scale) |
template<typename T > | |
static void | EncodeToFixedLenByteArray (uint8_t *buffer, int fixed_len_size, const T &v) |
Write decimals as big endian (byte comparable) in fixed_len_size bytes. More... | |
template<typename T > | |
static void | DecodeFromFixedLenByteArray (const uint8_t *buffer, int fixed_len_size, T *v) |
Static Public Attributes | |
static int128_t | MAX_UNSCALED_DECIMAL |
Maximum absolute value of int128_t that we use. This is 38 digits of 9's. More... | |
Definition at line 29 of file decimal-util.h.
|
inlinestatic |
Definition at line 87 of file decimal-util.h.
References impala::BitUtil::ByteSwap().
Referenced by impala::ParquetPlainEncoder::Decode(), and impala::Literal::Literal().
|
inlinestatic |
Write decimals as big endian (byte comparable) in fixed_len_size bytes.
Definition at line 61 of file decimal-util.h.
References impala::BitUtil::ByteSwap().
Referenced by impala::ParquetPlainEncoder::Encode().
|
inlinestatic |
Definition at line 50 of file decimal-util.h.
|
inline |
Definition at line 109 of file decimal-util.h.
References LIKELY, and impala::ColumnType::MAX_DECIMAL4_PRECISION.
|
inline |
Definition at line 128 of file decimal-util.h.
References LIKELY, and impala::ColumnType::MAX_DECIMAL8_PRECISION.
|
inline |
Definition at line 156 of file decimal-util.h.
References LIKELY, and impala::ColumnType::MAX_PRECISION.
|
static |
Initializes MAX_UNSCALED_DECIMAL. Must be called once before using it.
Definition at line 22 of file decimal-util.cc.
References impala::ColumnType::MAX_PRECISION, and MAX_UNSCALED_DECIMAL.
Referenced by main().
|
inlinestatic |
TODO: do we need to handle overflow here or at a higher abstraction.
Definition at line 39 of file decimal-util.h.
References impala::ColumnType::scale, impala::ColumnType::type, and impala::TYPE_DECIMAL.
|
inlinestatic |
Definition at line 45 of file decimal-util.h.
|
static |
Maximum absolute value of int128_t that we use. This is 38 digits of 9's.
Definition at line 32 of file decimal-util.h.
Referenced by impala::DecimalValue< int128_t >::Add(), impala::DecimalValue< int128_t >::AdjustToSameScale(), impala::DecimalValue< int128_t >::Divide(), InitMaxUnscaledDecimal(), impala::DecimalValue< int128_t >::Multiply(), impala::DecimalOperators::RoundDecimalNegativeScale(), TEST(), and impala::TEST().