Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
Utilities for AnyVals. More...
#include <anyval-util.h>
Public Member Functions | |
template<> | |
bool | Equals (const ColumnType &type, const StringVal &x, const StringVal &y) |
template<> | |
bool | Equals (const ColumnType &type, const TimestampVal &x, const TimestampVal &y) |
template<> | |
bool | Equals (const ColumnType &type, const DecimalVal &x, const DecimalVal &y) |
Static Public Member Functions | |
static uint32_t | Hash (const BooleanVal &v, const FunctionContext::TypeDesc &, int seed) |
static uint32_t | Hash (const TinyIntVal &v, const FunctionContext::TypeDesc &, int seed) |
static uint32_t | Hash (const SmallIntVal &v, const FunctionContext::TypeDesc &, int seed) |
static uint32_t | Hash (const IntVal &v, const FunctionContext::TypeDesc &, int seed) |
static uint32_t | Hash (const BigIntVal &v, const FunctionContext::TypeDesc &, int seed) |
static uint32_t | Hash (const FloatVal &v, const FunctionContext::TypeDesc &, int seed) |
static uint32_t | Hash (const DoubleVal &v, const FunctionContext::TypeDesc &, int seed) |
static uint32_t | Hash (const StringVal &v, const FunctionContext::TypeDesc &, int seed) |
static uint32_t | Hash (const TimestampVal &v, const FunctionContext::TypeDesc &, int seed) |
static uint64_t | Hash (const DecimalVal &v, const FunctionContext::TypeDesc &t, int64_t seed) |
static uint64_t | Hash64 (const BooleanVal &v, const FunctionContext::TypeDesc &, int64_t seed) |
static uint64_t | Hash64 (const TinyIntVal &v, const FunctionContext::TypeDesc &, int64_t seed) |
static uint64_t | Hash64 (const SmallIntVal &v, const FunctionContext::TypeDesc &, int64_t seed) |
static uint64_t | Hash64 (const IntVal &v, const FunctionContext::TypeDesc &, int64_t seed) |
static uint64_t | Hash64 (const BigIntVal &v, const FunctionContext::TypeDesc &, int64_t seed) |
static uint64_t | Hash64 (const FloatVal &v, const FunctionContext::TypeDesc &, int64_t seed) |
static uint64_t | Hash64 (const DoubleVal &v, const FunctionContext::TypeDesc &, int64_t seed) |
static uint64_t | Hash64 (const StringVal &v, const FunctionContext::TypeDesc &, int64_t seed) |
static uint64_t | Hash64 (const TimestampVal &v, const FunctionContext::TypeDesc &, int64_t seed) |
static uint64_t | Hash64 (const DecimalVal &v, const FunctionContext::TypeDesc &t, int64_t seed) |
template<typename T > | |
static bool | Equals (const FunctionContext::TypeDesc *type, const T &x, const T &y) |
Templated equality functions. These assume the input values are not NULL. More... | |
template<typename T > | |
static bool | Equals (const ColumnType &type, const T &x, const T &y) |
static int | AnyValSize (const ColumnType &t) |
Returns the byte size of *Val for type t. More... | |
static std::string | ToString (const StringVal &v) |
static StringVal | FromString (FunctionContext *ctx, const std::string &s) |
static void | TruncateIfNecessary (const ColumnType &type, StringVal *val) |
static StringVal | FromBuffer (FunctionContext *ctx, const char *ptr, int len) |
static FunctionContext::TypeDesc | ColumnTypeToTypeDesc (const ColumnType &type) |
static ColumnType | TypeDescToColumnType (const FunctionContext::TypeDesc &type) |
static void | SetAnyVal (const void *slot, const ColumnType &type, AnyVal *dst) |
Utility to put val into an AnyVal struct. More... | |
Utilities for AnyVals.
Definition at line 32 of file anyval-util.h.
|
inlinestatic |
Returns the byte size of *Val for type t.
Definition at line 158 of file anyval-util.h.
References impala::ColumnType::type, impala::TYPE_BIGINT, impala::TYPE_BOOLEAN, impala::TYPE_CHAR, impala::TYPE_DECIMAL, impala::TYPE_DOUBLE, impala::TYPE_FLOAT, impala::TYPE_INT, impala::TYPE_SMALLINT, impala::TYPE_STRING, impala::TYPE_TIMESTAMP, impala::TYPE_TINYINT, and impala::TYPE_VARCHAR.
Referenced by impala::ScalarFnCall::EvaluateChildren(), impala::ScalarFnCall::GetCodegendComputeFn(), and impala::ScalarFnCall::Prepare().
|
static |
Definition at line 52 of file anyval-util.cc.
References impala::ColumnType::len, impala_udf::FunctionContext::TypeDesc::len, impala::ColumnType::precision, impala_udf::FunctionContext::TypeDesc::precision, impala::ColumnType::scale, impala_udf::FunctionContext::TypeDesc::scale, impala::ColumnType::type, impala_udf::FunctionContext::TypeDesc::type, impala::TYPE_BIGINT, impala_udf::FunctionContext::TYPE_BIGINT, impala::TYPE_BOOLEAN, impala_udf::FunctionContext::TYPE_BOOLEAN, impala::TYPE_CHAR, impala::TYPE_DECIMAL, impala_udf::FunctionContext::TYPE_DECIMAL, impala::TYPE_DOUBLE, impala_udf::FunctionContext::TYPE_DOUBLE, impala_udf::FunctionContext::TYPE_FIXED_BUFFER, impala::TYPE_FLOAT, impala_udf::FunctionContext::TYPE_FLOAT, impala::TYPE_INT, impala_udf::FunctionContext::TYPE_INT, impala::TYPE_SMALLINT, impala_udf::FunctionContext::TYPE_SMALLINT, impala::TYPE_STRING, impala_udf::FunctionContext::TYPE_STRING, impala::TYPE_TIMESTAMP, impala_udf::FunctionContext::TYPE_TIMESTAMP, impala::TYPE_TINYINT, impala_udf::FunctionContext::TYPE_TINYINT, impala::TYPE_VARCHAR, and impala_udf::FunctionContext::TYPE_VARCHAR.
Referenced by impala::ScalarFnCall::Prepare(), impala::AggFnEvaluator::Prepare(), and impala::Expr::RegisterFunctionContext().
|
inlinestatic |
Templated equality functions. These assume the input values are not NULL.
Definition at line 145 of file anyval-util.h.
Referenced by impala::CaseExpr::AnyValEq().
|
inlinestatic |
Definition at line 151 of file anyval-util.h.
|
inline |
Definition at line 290 of file anyval-util.h.
References impala_udf::AnyVal::is_null.
|
inline |
Definition at line 299 of file anyval-util.h.
References impala_udf::AnyVal::is_null.
|
inline |
Definition at line 308 of file anyval-util.h.
References impala_udf::AnyVal::is_null, impala::ColumnType::precision, impala_udf::DecimalVal::val16, impala_udf::DecimalVal::val4, and impala_udf::DecimalVal::val8.
|
inlinestatic |
Definition at line 195 of file anyval-util.h.
References impala_udf::StringVal::ptr.
Referenced by impala::MathFunctions::Bin(), impala::MathFunctions::DecimalToBase(), and impala::MathFunctions::Unhex().
|
inlinestatic |
Definition at line 183 of file anyval-util.h.
Referenced by impala::CastFunctions::CastToStringVal(), impala::MathFunctions::HexInt(), and impala::MathFunctions::HexString().
|
inlinestatic |
Definition at line 34 of file anyval-util.h.
References Hash(), and impala_udf::BooleanVal::val.
Referenced by impala::AggregateFunctions::PcsaUpdate(), and impala::AggregateFunctions::PcUpdate().
|
inlinestatic |
Definition at line 38 of file anyval-util.h.
References Hash(), and impala_udf::TinyIntVal::val.
|
inlinestatic |
Definition at line 42 of file anyval-util.h.
References Hash(), and impala_udf::SmallIntVal::val.
|
inlinestatic |
Definition at line 46 of file anyval-util.h.
References Hash(), and impala_udf::IntVal::val.
|
inlinestatic |
Definition at line 50 of file anyval-util.h.
References Hash(), and impala_udf::BigIntVal::val.
|
inlinestatic |
Definition at line 54 of file anyval-util.h.
References Hash(), and impala_udf::FloatVal::val.
|
inlinestatic |
Definition at line 58 of file anyval-util.h.
References Hash(), and impala_udf::DoubleVal::val.
|
inlinestatic |
Definition at line 62 of file anyval-util.h.
References Hash(), impala_udf::StringVal::len, and impala_udf::StringVal::ptr.
|
inlinestatic |
Definition at line 66 of file anyval-util.h.
References impala::TimestampValue::Hash().
|
inlinestatic |
Definition at line 72 of file anyval-util.h.
References Hash(), impala_udf::FunctionContext::TypeDesc::precision, impala_udf::DecimalVal::val16, impala_udf::DecimalVal::val4, and impala_udf::DecimalVal::val8.
|
inlinestatic |
Definition at line 85 of file anyval-util.h.
References impala_udf::BooleanVal::val.
Referenced by impala::AggregateFunctions::HllUpdate().
|
inlinestatic |
Definition at line 90 of file anyval-util.h.
References impala_udf::TinyIntVal::val.
|
inlinestatic |
Definition at line 95 of file anyval-util.h.
References impala_udf::SmallIntVal::val.
|
inlinestatic |
Definition at line 100 of file anyval-util.h.
References impala_udf::IntVal::val.
|
inlinestatic |
Definition at line 105 of file anyval-util.h.
References impala_udf::BigIntVal::val.
|
inlinestatic |
Definition at line 110 of file anyval-util.h.
References impala_udf::FloatVal::val.
|
inlinestatic |
Definition at line 115 of file anyval-util.h.
References impala_udf::DoubleVal::val.
|
inlinestatic |
Definition at line 120 of file anyval-util.h.
References impala_udf::StringVal::len, and impala_udf::StringVal::ptr.
|
inlinestatic |
Definition at line 125 of file anyval-util.h.
|
inlinestatic |
Definition at line 131 of file anyval-util.h.
References impala_udf::FunctionContext::TypeDesc::precision, impala_udf::DecimalVal::val16, impala_udf::DecimalVal::val4, and impala_udf::DecimalVal::val8.
|
inlinestatic |
Utility to put val into an AnyVal struct.
Definition at line 205 of file anyval-util.h.
References impala::ColumnType::GetByteSize(), impala_udf::AnyVal::is_null, impala::ColumnType::IsVarLen(), impala::ColumnType::len, impala_udf::StringVal::len, impala_udf::StringVal::ptr, impala::ToStringVal(), impala::ColumnType::type, impala::TYPE_BIGINT, impala::TYPE_BOOLEAN, impala::TYPE_CHAR, impala::TYPE_DECIMAL, impala::TYPE_DOUBLE, impala::TYPE_FLOAT, impala::TYPE_INT, impala::TYPE_NULL, impala::TYPE_SMALLINT, impala::TYPE_STRING, impala::TYPE_TIMESTAMP, impala::TYPE_TINYINT, and impala::TYPE_VARCHAR.
Referenced by impala::HiveUdfCall::Evaluate(), impala::ScalarFnCall::EvaluateChildren(), impala::AggFnEvaluator::SerializeOrFinalize(), SetAnyVal(), and impala::AggFnEvaluator::Update().
|
inlinestatic |
Definition at line 179 of file anyval-util.h.
References impala_udf::StringVal::len, and impala_udf::StringVal::ptr.
|
inlinestatic |
Definition at line 188 of file anyval-util.h.
References impala::ColumnType::len, impala_udf::StringVal::len, impala::ColumnType::type, and impala::TYPE_VARCHAR.
Referenced by impala::CastFunctions::CastToStringVal().
|
static |
Definition at line 101 of file anyval-util.cc.
References impala::INVALID_TYPE, impala_udf::FunctionContext::TypeDesc::len, impala_udf::FunctionContext::TypeDesc::precision, impala_udf::FunctionContext::TypeDesc::scale, impala_udf::FunctionContext::TypeDesc::type, impala::TYPE_BIGINT, impala_udf::FunctionContext::TYPE_BIGINT, impala::TYPE_BOOLEAN, impala_udf::FunctionContext::TYPE_BOOLEAN, impala_udf::FunctionContext::TYPE_DECIMAL, impala::TYPE_DOUBLE, impala_udf::FunctionContext::TYPE_DOUBLE, impala_udf::FunctionContext::TYPE_FIXED_BUFFER, impala::TYPE_FLOAT, impala_udf::FunctionContext::TYPE_FLOAT, impala::TYPE_INT, impala_udf::FunctionContext::TYPE_INT, impala::TYPE_SMALLINT, impala_udf::FunctionContext::TYPE_SMALLINT, impala::TYPE_STRING, impala_udf::FunctionContext::TYPE_STRING, impala::TYPE_TIMESTAMP, impala_udf::FunctionContext::TYPE_TIMESTAMP, impala::TYPE_TINYINT, impala_udf::FunctionContext::TYPE_TINYINT, and impala_udf::FunctionContext::TYPE_VARCHAR.
Referenced by impala::DecimalFunctions::Abs(), impala::DecimalOperators::CastToBooleanVal(), impala::CastFunctions::CastToChar(), impala::DecimalOperators::CastToDecimalVal(), impala::DecimalOperators::CastToStringVal(), impala::CastFunctions::CastToStringVal(), impala::DecimalOperators::CastToTimestampVal(), impala::AggregateFunctions::DecimalAvgAddOrRemove(), impala::MathFunctions::LeastGreatest(), impala::MathFunctions::Negative(), impala::ConditionalFunctions::NullIfZero(), impala::DecimalOperators::RoundDecimal(), and impala::DecimalFunctions::RoundTo().