|
Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <iostream>#include <gtest/gtest.h>#include "common/logging.h"#include "udf/uda-test-harness.h"#include "testutil/test-udas.h"#include "common/names.h"Go to the source code of this file.
Classes | |
| struct | MinState |
Functions | |
| void | CountInit (FunctionContext *context, BigIntVal *val) |
| This is an example of the COUNT aggregate function. More... | |
| void | CountUpdate (FunctionContext *context, const IntVal &input, BigIntVal *val) |
| void | CountMerge (FunctionContext *context, const BigIntVal &src, BigIntVal *dst) |
| BigIntVal | CountFinalize (FunctionContext *context, const BigIntVal &val) |
| void | Count2Update (FunctionContext *context, const IntVal &input1, const IntVal &input2, BigIntVal *val) |
| void | Count3Update (FunctionContext *context, const IntVal &input1, const IntVal &input2, const IntVal &input3, BigIntVal *val) |
| void | Count4Update (FunctionContext *context, const IntVal &input1, const IntVal &input2, const IntVal &input3, const IntVal &input4, BigIntVal *val) |
| void | MinInit (FunctionContext *context, BufferVal *val) |
| void | MinUpdate (FunctionContext *context, const StringVal &input, BufferVal *val) |
| const BufferVal | MinSerialize (FunctionContext *context, const BufferVal &intermediate) |
| void | MinMerge (FunctionContext *context, const BufferVal &src, BufferVal *dst) |
| StringVal | MinFinalize (FunctionContext *context, const BufferVal &val) |
| void | XorInit (FunctionContext *context, BigIntVal *val) |
| void | XorUpdate (FunctionContext *context, const double *input, BigIntVal *val) |
| void | XorMerge (FunctionContext *context, const BigIntVal &src, BigIntVal *dst) |
| BigIntVal | XorFinalize (FunctionContext *context, const BigIntVal &val) |
| void | DistinctEstimateInit (FunctionContext *context, StringVal *val) |
| void | DistinctEstimatUpdate (FunctionContext *context, const int64_t *input, StringVal *val) |
| StringVal | DistinctEstimatSerialize (FunctionContext *context, const StringVal &intermediate) |
| void | DistinctEstimateMerge (FunctionContext *context, const StringVal &src, StringVal *dst) |
| BigIntVal | DistinctEstimateFinalize (FunctionContext *context, const StringVal &val) |
| TEST (CountTest, Basic) | |
| TEST (CountMultiArgTest, Basic) | |
| bool | FuzzyCompare (const BigIntVal &r1, const BigIntVal &r2) |
| TEST (CountTest, FuzzyEquals) | |
| TEST (MinTest, Basic) | |
| TEST (MemTest, Basic) | |
| int | main (int argc, char **argv) |
| void Count2Update | ( | FunctionContext * | context, |
| const IntVal & | input1, | ||
| const IntVal & | input2, | ||
| BigIntVal * | val | ||
| ) |
Definition at line 58 of file uda-test.cc.
References impala_udf::AnyVal::is_null, and impala_udf::BigIntVal::val.
Referenced by TEST().
| void Count3Update | ( | FunctionContext * | context, |
| const IntVal & | input1, | ||
| const IntVal & | input2, | ||
| const IntVal & | input3, | ||
| BigIntVal * | val | ||
| ) |
Definition at line 62 of file uda-test.cc.
References impala_udf::AnyVal::is_null, and impala_udf::BigIntVal::val.
Referenced by TEST().
| void Count4Update | ( | FunctionContext * | context, |
| const IntVal & | input1, | ||
| const IntVal & | input2, | ||
| const IntVal & | input3, | ||
| const IntVal & | input4, | ||
| BigIntVal * | val | ||
| ) |
Definition at line 66 of file uda-test.cc.
References impala_udf::AnyVal::is_null, and impala_udf::BigIntVal::val.
Referenced by TEST().
| BigIntVal CountFinalize | ( | FunctionContext * | context, |
| const BigIntVal & | val | ||
| ) |
Definition at line 49 of file uda-test.cc.
Referenced by TEST(), and TestCount().
| void CountInit | ( | FunctionContext * | context, |
| BigIntVal * | val | ||
| ) |
This is an example of the COUNT aggregate function.
Definition at line 34 of file uda-test.cc.
Referenced by TEST(), and TestCount().
| void CountMerge | ( | FunctionContext * | context, |
| const BigIntVal & | src, | ||
| BigIntVal * | dst | ||
| ) |
Definition at line 45 of file uda-test.cc.
Referenced by TEST(), and TestCount().
| void CountUpdate | ( | FunctionContext * | context, |
| const IntVal & | input, | ||
| BigIntVal * | val | ||
| ) |
Definition at line 39 of file uda-test.cc.
Referenced by TEST(), and TestCount().
| BigIntVal DistinctEstimateFinalize | ( | FunctionContext * | context, |
| const StringVal & | val | ||
| ) |
Definition at line 213 of file uda-test.cc.
| void DistinctEstimateInit | ( | FunctionContext * | context, |
| StringVal * | val | ||
| ) |
Definition at line 182 of file uda-test.cc.
References impala_udf::StringVal::len, and impala_udf::StringVal::ptr.
| void DistinctEstimateMerge | ( | FunctionContext * | context, |
| const StringVal & | src, | ||
| StringVal * | dst | ||
| ) |
Definition at line 206 of file uda-test.cc.
References impala_udf::StringVal::ptr.
| StringVal DistinctEstimatSerialize | ( | FunctionContext * | context, |
| const StringVal & | intermediate | ||
| ) |
Definition at line 199 of file uda-test.cc.
| void DistinctEstimatUpdate | ( | FunctionContext * | context, |
| const int64_t * | input, | ||
| StringVal * | val | ||
| ) |
Definition at line 188 of file uda-test.cc.
References impala::hash, and impala_udf::StringVal::ptr.
Definition at line 249 of file uda-test.cc.
References impala::abs(), impala_udf::AnyVal::is_null, and impala_udf::BigIntVal::val.
Referenced by TEST().
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 313 of file uda-test.cc.
References impala::InitGoogleLoggingSafe().
| StringVal MinFinalize | ( | FunctionContext * | context, |
| const BufferVal & | val | ||
| ) |
Definition at line 136 of file uda-test.cc.
References impala_udf::FunctionContext::Free(), MinState::len, impala_udf::StringVal::ptr, and MinState::value.
Referenced by TEST().
| void MinInit | ( | FunctionContext * | context, |
| BufferVal * | val | ||
| ) |
Definition at line 95 of file uda-test.cc.
References MinState::buffer_len, and MinState::value.
Referenced by TEST().
| void MinMerge | ( | FunctionContext * | context, |
| const BufferVal & | src, | ||
| BufferVal * | dst | ||
| ) |
Definition at line 129 of file uda-test.cc.
References MinState::len, MinUpdate(), and MinState::value.
Referenced by TEST().
| const BufferVal MinSerialize | ( | FunctionContext * | context, |
| const BufferVal & | intermediate | ||
| ) |
Definition at line 116 of file uda-test.cc.
References impala_udf::FunctionContext::Free(), MinState::len, impala_udf::StringVal::ptr, and MinState::value.
Referenced by TEST().
| void MinUpdate | ( | FunctionContext * | context, |
| const StringVal & | input, | ||
| BufferVal * | val | ||
| ) |
Definition at line 102 of file uda-test.cc.
References impala_udf::AnyVal::is_null, MinState::len, impala_udf::StringVal::len, impala_udf::StringVal::ptr, MinState::Set(), and MinState::value.
Referenced by MinMerge(), and TEST().
| TEST | ( | CountTest | , |
| Basic | |||
| ) |
Definition at line 220 of file uda-test.cc.
References CountFinalize(), CountInit(), CountMerge(), CountUpdate(), impala_udf::UdaTestHarness< RESULT, INTERMEDIATE, INPUT >::Execute(), and impala_udf::UdaTestHarnessBase< RESULT, INTERMEDIATE >::GetErrorMsg().
| TEST | ( | CountMultiArgTest | , |
| Basic | |||
| ) |
Definition at line 230 of file uda-test.cc.
References Count2Update(), Count3Update(), Count4Update(), CountFinalize(), CountInit(), CountMerge(), and impala_udf::UdaTestHarness2< RESULT, INTERMEDIATE, INPUT1, INPUT2 >::Execute().
| TEST | ( | CountTest | , |
| FuzzyEquals | |||
| ) |
Definition at line 255 of file uda-test.cc.
References CountFinalize(), CountInit(), CountMerge(), CountUpdate(), impala_udf::UdaTestHarness< RESULT, INTERMEDIATE, INPUT >::Execute(), FuzzyCompare(), impala_udf::UdaTestHarnessBase< RESULT, INTERMEDIATE >::GetErrorMsg(), and impala_udf::UdaTestHarnessBase< RESULT, INTERMEDIATE >::SetResultComparator().
| TEST | ( | MinTest | , |
| Basic | |||
| ) |
Definition at line 270 of file uda-test.cc.
References impala_udf::UdaTestHarness< RESULT, INTERMEDIATE, INPUT >::Execute(), impala_udf::UdaTestHarnessBase< RESULT, INTERMEDIATE >::GetErrorMsg(), MinFinalize(), MinInit(), MinMerge(), MinSerialize(), MinUpdate(), and impala_udf::UdaTestHarnessBase< RESULT, INTERMEDIATE >::SetIntermediateSize().
| TEST | ( | MemTest | , |
| Basic | |||
| ) |
Definition at line 298 of file uda-test.cc.
References impala_udf::UdaTestHarness< RESULT, INTERMEDIATE, INPUT >::Execute(), impala_udf::UdaTestHarnessBase< RESULT, INTERMEDIATE >::GetErrorMsg(), MemTestFinalize(), MemTestInit(), MemTestMerge(), MemTestSerialize(), and MemTestUpdate().
| BigIntVal XorFinalize | ( | FunctionContext * | context, |
| const BigIntVal & | val | ||
| ) |
Definition at line 167 of file uda-test.cc.
| void XorInit | ( | FunctionContext * | context, |
| BigIntVal * | val | ||
| ) |
Definition at line 152 of file uda-test.cc.
References impala_udf::AnyVal::is_null, and impala_udf::BigIntVal::val.
| void XorMerge | ( | FunctionContext * | context, |
| const BigIntVal & | src, | ||
| BigIntVal * | dst | ||
| ) |
Definition at line 163 of file uda-test.cc.
References impala_udf::BigIntVal::val.
| void XorUpdate | ( | FunctionContext * | context, |
| const double * | input, | ||
| BigIntVal * | val | ||
| ) |
Definition at line 157 of file uda-test.cc.
References impala_udf::BigIntVal::val.