Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::AnyValUtil Class Reference

Utilities for AnyVals. More...

#include <anyval-util.h>

Collaboration diagram for impala::AnyValUtil:

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...
 

Detailed Description

Utilities for AnyVals.

Definition at line 32 of file anyval-util.h.

Member Function Documentation

template<typename T >
static bool impala::AnyValUtil::Equals ( const FunctionContext::TypeDesc type,
const T &  x,
const T &  y 
)
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().

template<typename T >
static bool impala::AnyValUtil::Equals ( const ColumnType type,
const T &  x,
const T &  y 
)
inlinestatic

Definition at line 151 of file anyval-util.h.

template<>
bool impala::AnyValUtil::Equals ( const ColumnType type,
const StringVal x,
const StringVal y 
)
inline

Definition at line 290 of file anyval-util.h.

References impala_udf::AnyVal::is_null.

template<>
bool impala::AnyValUtil::Equals ( const ColumnType type,
const TimestampVal x,
const TimestampVal y 
)
inline

Definition at line 299 of file anyval-util.h.

References impala_udf::AnyVal::is_null.

template<>
bool impala::AnyValUtil::Equals ( const ColumnType type,
const DecimalVal x,
const DecimalVal y 
)
inline
static StringVal impala::AnyValUtil::FromBuffer ( FunctionContext ctx,
const char *  ptr,
int  len 
)
inlinestatic
static StringVal impala::AnyValUtil::FromString ( FunctionContext ctx,
const std::string &  s 
)
inlinestatic
static uint32_t impala::AnyValUtil::Hash ( const BooleanVal v,
const FunctionContext::TypeDesc ,
int  seed 
)
inlinestatic
static uint32_t impala::AnyValUtil::Hash ( const TinyIntVal v,
const FunctionContext::TypeDesc ,
int  seed 
)
inlinestatic

Definition at line 38 of file anyval-util.h.

References Hash(), and impala_udf::TinyIntVal::val.

static uint32_t impala::AnyValUtil::Hash ( const SmallIntVal v,
const FunctionContext::TypeDesc ,
int  seed 
)
inlinestatic

Definition at line 42 of file anyval-util.h.

References Hash(), and impala_udf::SmallIntVal::val.

static uint32_t impala::AnyValUtil::Hash ( const IntVal v,
const FunctionContext::TypeDesc ,
int  seed 
)
inlinestatic

Definition at line 46 of file anyval-util.h.

References Hash(), and impala_udf::IntVal::val.

static uint32_t impala::AnyValUtil::Hash ( const BigIntVal v,
const FunctionContext::TypeDesc ,
int  seed 
)
inlinestatic

Definition at line 50 of file anyval-util.h.

References Hash(), and impala_udf::BigIntVal::val.

static uint32_t impala::AnyValUtil::Hash ( const FloatVal v,
const FunctionContext::TypeDesc ,
int  seed 
)
inlinestatic

Definition at line 54 of file anyval-util.h.

References Hash(), and impala_udf::FloatVal::val.

static uint32_t impala::AnyValUtil::Hash ( const DoubleVal v,
const FunctionContext::TypeDesc ,
int  seed 
)
inlinestatic

Definition at line 58 of file anyval-util.h.

References Hash(), and impala_udf::DoubleVal::val.

static uint32_t impala::AnyValUtil::Hash ( const StringVal v,
const FunctionContext::TypeDesc ,
int  seed 
)
inlinestatic

Definition at line 62 of file anyval-util.h.

References Hash(), impala_udf::StringVal::len, and impala_udf::StringVal::ptr.

static uint32_t impala::AnyValUtil::Hash ( const TimestampVal v,
const FunctionContext::TypeDesc ,
int  seed 
)
inlinestatic

Definition at line 66 of file anyval-util.h.

References impala::TimestampValue::Hash().

static uint64_t impala::AnyValUtil::Hash ( const DecimalVal v,
const FunctionContext::TypeDesc t,
int64_t  seed 
)
inlinestatic
static uint64_t impala::AnyValUtil::Hash64 ( const BooleanVal v,
const FunctionContext::TypeDesc ,
int64_t  seed 
)
inlinestatic

Definition at line 85 of file anyval-util.h.

References impala_udf::BooleanVal::val.

Referenced by impala::AggregateFunctions::HllUpdate().

static uint64_t impala::AnyValUtil::Hash64 ( const TinyIntVal v,
const FunctionContext::TypeDesc ,
int64_t  seed 
)
inlinestatic

Definition at line 90 of file anyval-util.h.

References impala_udf::TinyIntVal::val.

static uint64_t impala::AnyValUtil::Hash64 ( const SmallIntVal v,
const FunctionContext::TypeDesc ,
int64_t  seed 
)
inlinestatic

Definition at line 95 of file anyval-util.h.

References impala_udf::SmallIntVal::val.

static uint64_t impala::AnyValUtil::Hash64 ( const IntVal v,
const FunctionContext::TypeDesc ,
int64_t  seed 
)
inlinestatic

Definition at line 100 of file anyval-util.h.

References impala_udf::IntVal::val.

static uint64_t impala::AnyValUtil::Hash64 ( const BigIntVal v,
const FunctionContext::TypeDesc ,
int64_t  seed 
)
inlinestatic

Definition at line 105 of file anyval-util.h.

References impala_udf::BigIntVal::val.

static uint64_t impala::AnyValUtil::Hash64 ( const FloatVal v,
const FunctionContext::TypeDesc ,
int64_t  seed 
)
inlinestatic

Definition at line 110 of file anyval-util.h.

References impala_udf::FloatVal::val.

static uint64_t impala::AnyValUtil::Hash64 ( const DoubleVal v,
const FunctionContext::TypeDesc ,
int64_t  seed 
)
inlinestatic

Definition at line 115 of file anyval-util.h.

References impala_udf::DoubleVal::val.

static uint64_t impala::AnyValUtil::Hash64 ( const StringVal v,
const FunctionContext::TypeDesc ,
int64_t  seed 
)
inlinestatic

Definition at line 120 of file anyval-util.h.

References impala_udf::StringVal::len, and impala_udf::StringVal::ptr.

static uint64_t impala::AnyValUtil::Hash64 ( const TimestampVal v,
const FunctionContext::TypeDesc ,
int64_t  seed 
)
inlinestatic

Definition at line 125 of file anyval-util.h.

static uint64_t impala::AnyValUtil::Hash64 ( const DecimalVal v,
const FunctionContext::TypeDesc t,
int64_t  seed 
)
inlinestatic
static std::string impala::AnyValUtil::ToString ( const StringVal v)
inlinestatic

Definition at line 179 of file anyval-util.h.

References impala_udf::StringVal::len, and impala_udf::StringVal::ptr.

static void impala::AnyValUtil::TruncateIfNecessary ( const ColumnType type,
StringVal val 
)
inlinestatic
ColumnType impala::AnyValUtil::TypeDescToColumnType ( const FunctionContext::TypeDesc type)
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().


The documentation for this class was generated from the following files: