Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
Go to the source code of this file.
Classes | |
struct | AvgStruct |
DoubleVal AvgFinalize | ( | FunctionContext * | context, |
const BufferVal & | val | ||
) |
Definition at line 69 of file uda-sample.cc.
References AvgStruct::count, impala_udf::DoubleVal::null(), and AvgStruct::sum.
Referenced by TestAvg().
void AvgInit | ( | FunctionContext * | context, |
BufferVal * | val | ||
) |
This is an example of the AVG(double) aggregate function. This function needs to maintain two pieces of state, the current sum and the count. We do this using the BufferVal intermediate type. When this UDA is registered, it would specify 16 bytes (8 byte sum + 8 byte count) as the size for this buffer.
Definition at line 49 of file uda-sample.cc.
Referenced by TestAvg().
void AvgMerge | ( | FunctionContext * | context, |
const BufferVal & | src, | ||
BufferVal * | dst | ||
) |
Definition at line 61 of file uda-sample.cc.
References AvgStruct::count, and AvgStruct::sum.
Referenced by TestAvg().
void AvgUpdate | ( | FunctionContext * | context, |
const DoubleVal & | input, | ||
BufferVal * | val | ||
) |
Definition at line 54 of file uda-sample.cc.
References AvgStruct::count, impala_udf::AnyVal::is_null, AvgStruct::sum, and impala_udf::DoubleVal::val.
Referenced by TestAvg().
BigIntVal CountFinalize | ( | FunctionContext * | context, |
const BigIntVal & | val | ||
) |
Definition at line 37 of file uda-sample.cc.
void CountInit | ( | FunctionContext * | context, |
BigIntVal * | val | ||
) |
This is an example of the COUNT aggregate function.
Definition at line 23 of file uda-sample.cc.
References impala_udf::AnyVal::is_null, and impala_udf::BigIntVal::val.
void CountMerge | ( | FunctionContext * | context, |
const BigIntVal & | src, | ||
BigIntVal * | dst | ||
) |
Definition at line 33 of file uda-sample.cc.
References impala_udf::BigIntVal::val.
void CountUpdate | ( | FunctionContext * | context, |
const IntVal & | input, | ||
BigIntVal * | val | ||
) |
Definition at line 28 of file uda-sample.cc.
References impala_udf::AnyVal::is_null, and impala_udf::BigIntVal::val.
StringVal StringConcatFinalize | ( | FunctionContext * | context, |
const StringVal & | val | ||
) |
Definition at line 104 of file uda-sample.cc.
Referenced by TestStringConcat().
void StringConcatInit | ( | FunctionContext * | context, |
StringVal * | val | ||
) |
This is a sample of implementing the STRING_CONCAT aggregate function. Example: select string_concat(string_col, ",") from table
Definition at line 79 of file uda-sample.cc.
References impala_udf::AnyVal::is_null.
Referenced by TestStringConcat().
void StringConcatMerge | ( | FunctionContext * | context, |
const StringVal & | src, | ||
StringVal * | dst | ||
) |
Definition at line 99 of file uda-sample.cc.
References impala_udf::AnyVal::is_null, and StringConcatUpdate().
Referenced by TestStringConcat().
void StringConcatUpdate | ( | FunctionContext * | context, |
const StringVal & | arg1, | ||
const StringVal & | arg2, | ||
StringVal * | val | ||
) |
Definition at line 83 of file uda-sample.cc.
References impala_udf::AnyVal::is_null, impala_udf::StringVal::len, and impala_udf::StringVal::ptr.
Referenced by StringConcatMerge(), and TestStringConcat().
void SumSmallDecimalInit | ( | FunctionContext * | , |
DecimalVal * | val | ||
) |
Definition at line 114 of file uda-sample.cc.
References impala_udf::AnyVal::is_null, and impala_udf::DecimalVal::val4.
void SumSmallDecimalMerge | ( | FunctionContext * | , |
const DecimalVal & | src, | ||
DecimalVal * | dst | ||
) |
Definition at line 128 of file uda-sample.cc.
References impala_udf::AnyVal::is_null, and impala_udf::DecimalVal::val4.
void SumSmallDecimalUpdate | ( | FunctionContext * | ctx, |
const DecimalVal & | src, | ||
DecimalVal * | dst | ||
) |
Definition at line 119 of file uda-sample.cc.
References impala_udf::FunctionContext::GetArgType(), impala_udf::AnyVal::is_null, impala_udf::FunctionContext::TypeDesc::precision, impala_udf::FunctionContext::TypeDesc::scale, and impala_udf::DecimalVal::val4.