Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <math-functions.h>
Public Member Functions | |
template<> | |
DecimalVal | Negative (FunctionContext *ctx, const DecimalVal &val) |
Static Private Member Functions | |
static StringVal | DecimalToBase (FunctionContext *, int64_t src_num, int8_t dest_base) |
Converts src_num in decimal to dest_base. More... | |
static bool | DecimalInBaseToDecimal (int64_t src_num, int8_t src_base, int64_t *result) |
static bool | HandleParseResult (int8_t dest_base, int64_t *num, StringParser::ParseResult parse_res) |
Static Private Attributes | |
static const int32_t | MIN_BASE = 2 |
static const int32_t | MAX_BASE = 36 |
static const char * | ALPHANUMERIC_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
Definition at line 32 of file math-functions.h.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 156 of file math-functions.cc.
References impala::AnyValUtil::FromBuffer(), impala_udf::AnyVal::is_null, and impala_udf::BigIntVal::val.
|
static |
|
static |
Definition at line 245 of file math-functions.cc.
References impala::abs(), DecimalInBaseToDecimal(), DecimalToBase(), HandleParseResult(), impala_udf::AnyVal::is_null, MAX_BASE, MIN_BASE, impala::StringParser::PARSE_OVERFLOW, impala_udf::TinyIntVal::val, and impala_udf::BigIntVal::val.
|
static |
Definition at line 271 of file math-functions.cc.
References impala::abs(), DecimalToBase(), HandleParseResult(), impala_udf::AnyVal::is_null, impala_udf::StringVal::len, MAX_BASE, MIN_BASE, impala_udf::StringVal::ptr, and impala_udf::TinyIntVal::val.
|
static |
|
staticprivate |
Converts src_num representing a number in src_base but encoded in decimal into its actual decimal number. For example, if src_num is 21 and src_base is 5, then this function sets *result to 2*5^1 + 1*5^0 = 11. Returns false if overflow occurred, true upon success.
Definition at line 328 of file math-functions.cc.
References impala::abs(), and UNLIKELY.
Referenced by ConvInt().
|
staticprivate |
Converts src_num in decimal to dest_base.
Definition at line 297 of file math-functions.cc.
References impala::abs(), ALPHANUMERIC_CHARS, and impala::AnyValUtil::FromBuffer().
Referenced by ConvInt(), and ConvString().
|
static |
Definition at line 82 of file math-functions.cc.
References impala_udf::AnyVal::is_null, and impala_udf::DoubleVal::val.
|
static |
Definition at line 42 of file math-functions.cc.
|
static |
|
static |
|
static |
Definition at line 388 of file math-functions.cc.
References impala_udf::AnyVal::is_null, and impala_udf::DoubleVal::val.
|
static |
Definition at line 382 of file math-functions.cc.
References impala_udf::AnyVal::is_null, and impala_udf::FloatVal::val.
|
staticprivate |
Helper function used in Conv to implement behavior consistent with MySQL and Hive in case of numeric overflow during Conv. Inspects parse_res, and in case of overflow sets num to MAXINT64 if dest_base is positive, otherwise to -1. Returns true if no parse_res == PARSE_SUCCESS || parse_res == PARSE_OVERFLOW. Returns false otherwise, indicating some other error condition.
Definition at line 353 of file math-functions.cc.
References impala::StringParser::PARSE_FAILURE, and impala::StringParser::PARSE_OVERFLOW.
Referenced by ConvInt(), and ConvString().
|
static |
Definition at line 171 of file math-functions.cc.
References impala::AnyValUtil::FromString(), impala_udf::AnyVal::is_null, and impala_udf::BigIntVal::val.
|
static |
Definition at line 179 of file math-functions.cc.
References impala::AnyValUtil::FromString(), impala_udf::AnyVal::is_null, impala_udf::StringVal::len, and impala_udf::StringVal::ptr.
|
static |
Definition at line 433 of file math-functions.cc.
|
static |
Definition at line 449 of file math-functions.cc.
References impala::StringValue::FromStringVal(), and impala::StringValue::ToStringVal().
|
static |
Definition at line 468 of file math-functions.cc.
References impala::TimestampValue::FromTimestampVal(), and impala::TimestampValue::ToTimestampVal().
|
static |
Definition at line 487 of file math-functions.cc.
References impala::ColumnType::GetByteSize(), impala_udf::FunctionContext::GetReturnType(), impala::AnyValUtil::TypeDescToColumnType(), impala_udf::DecimalVal::val16, impala_udf::DecimalVal::val4, and impala_udf::DecimalVal::val8.
|
static |
|
static |
Definition at line 103 of file math-functions.cc.
References impala_udf::AnyVal::is_null, and impala_udf::DoubleVal::val.
|
static |
|
static |
Definition at line 98 of file math-functions.cc.
References impala_udf::AnyVal::is_null, and impala_udf::DoubleVal::val.
|
static |
Definition at line 398 of file math-functions.cc.
DecimalVal impala::MathFunctions::Negative | ( | FunctionContext * | ctx, |
const DecimalVal & | val | ||
) |
Definition at line 404 of file math-functions.cc.
References impala::ColumnType::GetByteSize(), impala_udf::FunctionContext::GetReturnType(), impala_udf::AnyVal::is_null, impala::AnyValUtil::TypeDescToColumnType(), impala_udf::DecimalVal::val16, impala_udf::DecimalVal::val4, and impala_udf::DecimalVal::val8.
|
static |
Definition at line 38 of file math-functions.cc.
Referenced by impala::Expr::InitBuiltinsDummy().
|
static |
Definition at line 370 of file math-functions.cc.
References impala_udf::AnyVal::is_null, and impala_udf::BigIntVal::val.
|
static |
Definition at line 376 of file math-functions.cc.
References impala_udf::AnyVal::is_null, and impala_udf::DoubleVal::val.
|
static |
Definition at line 394 of file math-functions.cc.
|
static |
Definition at line 109 of file math-functions.cc.
References impala_udf::AnyVal::is_null, and impala_udf::DoubleVal::val.
|
static |
Definition at line 428 of file math-functions.cc.
References impala::Operators::Int_divide_BigIntVal_BigIntVal().
|
static |
Definition at line 420 of file math-functions.cc.
References impala_udf::AnyVal::is_null, and impala_udf::DoubleVal::val.
|
static |
Definition at line 77 of file math-functions.cc.
References impala_udf::AnyVal::is_null, and impala_udf::DoubleVal::val.
|
static |
Definition at line 142 of file math-functions.cc.
References impala_udf::FunctionContext::GetFunctionState().
Referenced by RandSeed().
|
static |
Used for both Rand() and RandSeed()
Definition at line 115 of file math-functions.cc.
References impala_udf::FunctionContext::Allocate(), impala_udf::FunctionContext::GetArgType(), impala_udf::FunctionContext::GetConstantArg(), impala_udf::FunctionContext::GetNumArgs(), impala_udf::FunctionContext::IsArgConstant(), impala_udf::FunctionContext::SetError(), impala_udf::FunctionContext::SetFunctionState(), impala_udf::FunctionContext::TypeDesc::type, impala::TYPE_BIGINT, and impala_udf::BigIntVal::val.
|
static |
Definition at line 151 of file math-functions.cc.
References impala_udf::AnyVal::is_null, and Rand().
|
static |
Definition at line 87 of file math-functions.cc.
References impala_udf::AnyVal::is_null, and impala_udf::DoubleVal::val.
|
static |
Definition at line 92 of file math-functions.cc.
References impala_udf::AnyVal::is_null, impala_udf::IntVal::val, and impala_udf::DoubleVal::val.
|
static |
Definition at line 72 of file math-functions.cc.
References impala_udf::AnyVal::is_null, and impala_udf::DoubleVal::val.
|
static |
|
static |
|
static |
|
static |
Definition at line 191 of file math-functions.cc.
References impala::AnyValUtil::FromBuffer(), impala_udf::AnyVal::is_null, impala_udf::StringVal::len, and impala_udf::StringVal::ptr.
|
staticprivate |
Definition at line 99 of file math-functions.h.
Referenced by DecimalToBase().
|
staticprivate |
Definition at line 98 of file math-functions.h.
Referenced by ConvInt(), and ConvString().
|
staticprivate |
Definition at line 97 of file math-functions.h.
Referenced by ConvInt(), and ConvString().