17 #include <gutil/strings/substitute.h>
27 using namespace strings;
33 if (input_val.
is_null)
return BigIntVal::null();
34 return BigIntVal(HashUtil::FnvHash64(input_val.
ptr, input_val.
len, HashUtil::FNV_SEED));
39 if (input_val.
is_null)
return BigIntVal::null();
41 return BigIntVal(HashUtil::FnvHash64(&tv, 12, HashUtil::FNV_SEED));
46 if (input_val.is_null)
return BigIntVal::null();
48 HashUtil::FnvHash64(&input_val.val,
sizeof(input_val.val), HashUtil::FNV_SEED));
55 if (input_val.
is_null)
return BigIntVal::null();
58 return BigIntVal(HashUtil::FnvHash64(&input_val.
val16, byte_size, HashUtil::FNV_SEED));
79 return (user.len > 0) ? user : StringVal::null();
89 if (pid == -1)
return IntVal::null();
96 if (milliseconds.
is_null)
return BooleanVal::null();
105 return (database.
len > 0) ? database : StringVal::null();
111 ColumnType column_type = AnyValUtil::TypeDescToColumnType(type_desc);
114 switch(column_type.
type) {
117 return AnyValUtil::FromString(ctx, Substitute(
"$0($1,$2)", type_string,
122 return AnyValUtil::FromString(ctx, Substitute(
"$0($1)", type_string,
125 return AnyValUtil::FromString(ctx, type_string);
int precision
Only valid if type == TYPE_DECIMAL.
impala::FunctionContextImpl * impl()
TODO: Add mechanism for UDAs to update stats similar to runtime profile counters. ...
string GetVersionString(bool compact)
Returns "<program short name> version <GetBuildVersion(compact)>".
This object has a compatible storage format with boost::ptime.
void SleepForMs(const int64_t duration_ms)
Sleeps the current thread for at least duration_ms milliseconds.
string TypeToString(PrimitiveType t)
const TypeDesc * GetArgType(int arg_idx) const
static uint64_t FnvHash(const void *data, int32_t bytes, uint64_t hash)
int GetByteSize() const
Returns the byte size of this type. Returns 0 for variable length types.
const TQueryCtx & query_ctx() const
const char * user() const
int len
Only valid if type == TYPE_FIXED_BUFFER || type == TYPE_VARCHAR.