Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
udf-test.cc File Reference
#include <gtest/gtest.h>
#include <iostream>
#include <boost/date_time/posix_time/posix_time.hpp>
#include "common/logging.h"
#include "runtime/multi-precision.h"
#include "testutil/test-udfs.h"
#include "udf/udf-test-harness.h"
#include "common/names.h"
Include dependency graph for udf-test.cc:

Go to the source code of this file.

Functions

DoubleVal ZeroUdf (FunctionContext *context)
 
StringVal LogUdf (FunctionContext *context, const StringVal &arg1)
 
StringVal UpperUdf (FunctionContext *context, const StringVal &input)
 
FloatVal Min3 (FunctionContext *context, const FloatVal &f1, const FloatVal &f2, const FloatVal &f3)
 
StringVal Concat (FunctionContext *context, int n, const StringVal *args)
 
IntVal NumVarArgs (FunctionContext *, const BigIntVal &dummy, int n, const IntVal *args)
 
IntVal ValidateUdf (FunctionContext *context)
 
IntVal ValidateFail (FunctionContext *context)
 
IntVal ValidateMem (FunctionContext *context)
 
StringVal TimeToString (FunctionContext *context, const TimestampVal &time)
 
void ValidateSharedStatePrepare (FunctionContext *context, FunctionContext::FunctionStateScope scope)
 
SmallIntVal ValidateSharedState (FunctionContext *context, SmallIntVal bytes)
 
void ValidateSharedStateClose (FunctionContext *context, FunctionContext::FunctionStateScope scope)
 
 TEST (UdfTest, TestFunctionContext)
 
 TEST (UdfTest, TestValidate)
 
 TEST (UdfTest, TestTimestampVal)
 
 TEST (UdfTest, TestDecimalVal)
 
 TEST (UdfTest, TestVarArgs)
 
 TEST (UdfTest, MemTest)
 
int main (int argc, char **argv)
 

Function Documentation

StringVal Concat ( FunctionContext context,
int  n,
const StringVal args 
)

Definition at line 84 of file udf-test.cc.

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

Referenced by TEST().

StringVal LogUdf ( FunctionContext context,
const StringVal arg1 
)

Definition at line 38 of file udf-test.cc.

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

Referenced by TEST().

int main ( int  argc,
char **  argv 
)

Definition at line 279 of file udf-test.cc.

References impala::InitGoogleLoggingSafe().

FloatVal Min3 ( FunctionContext context,
const FloatVal f1,
const FloatVal f2,
const FloatVal f3 
)

Definition at line 53 of file udf-test.cc.

References impala_udf::AnyVal::is_null, and impala_udf::FloatVal::val.

Referenced by TEST().

IntVal NumVarArgs ( FunctionContext ,
const BigIntVal dummy,
int  n,
const IntVal args 
)

Definition at line 104 of file udf-test.cc.

Referenced by TEST().

TEST ( UdfTest  ,
TestFunctionContext   
)
TEST ( UdfTest  ,
TestValidate   
)

Definition at line 187 of file udf-test.cc.

References LogUdf(), Min3(), UpperUdf(), and ZeroUdf().

TEST ( UdfTest  ,
TestTimestampVal   
)

Definition at line 205 of file udf-test.cc.

References TimeToString().

TEST ( UdfTest  ,
TestDecimalVal   
)

Definition at line 216 of file udf-test.cc.

References impala_udf::AnyVal::is_null, and impala_udf::DecimalVal::val16.

TEST ( UdfTest  ,
TestVarArgs   
)

Definition at line 247 of file udf-test.cc.

References Concat(), and NumVarArgs().

TEST ( UdfTest  ,
MemTest   
)

Definition at line 265 of file udf-test.cc.

References DoubleFreeTest(), MemTest(), MemTestClose(), and MemTestPrepare().

StringVal TimeToString ( FunctionContext context,
const TimestampVal time 
)

Definition at line 133 of file udf-test.cc.

References impala_udf::TimestampVal::date, and impala_udf::TimestampVal::time_of_day.

Referenced by TEST().

StringVal UpperUdf ( FunctionContext context,
const StringVal input 
)

Definition at line 43 of file udf-test.cc.

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

Referenced by TEST().

IntVal ValidateMem ( FunctionContext context)

Definition at line 124 of file udf-test.cc.

References impala_udf::FunctionContext::Allocate(), and impala_udf::FunctionContext::Free().

Referenced by TEST().

SmallIntVal ValidateSharedState ( FunctionContext context,
SmallIntVal  bytes 
)

Definition at line 158 of file udf-test.cc.

References impala_udf::FunctionContext::GetFunctionState(), and impala_udf::SmallIntVal::val.

Referenced by TEST().

DoubleVal ZeroUdf ( FunctionContext context)

Definition at line 34 of file udf-test.cc.

Referenced by TEST().