16 #ifndef IMPALA_UDF_UDF_H
17 #define IMPALA_UDF_UDF_H
20 #include <boost/cstdint.hpp>
27 class FunctionContextImpl;
30 namespace impala_udf {
114 const char*
user()
const;
146 uint8_t*
Reallocate(uint8_t* ptr,
int byte_size);
149 void Free(uint8_t* buffer);
156 void Free(int64_t byte_size);
180 const TypeDesc*
GetArgType(
int arg_idx)
const;
550 if (
len != other.
len)
return false;
590 memcpy(reinterpret_cast<void*>(
this), reinterpret_cast<const void*>(&other),
bool operator==(const IntVal &other) const
int precision
Only valid if type == TYPE_DECIMAL.
bool operator!=(const FloatVal &other) const
void(* UdfClose)(FunctionContext *context, FunctionContext::FunctionStateScope scope)
bool operator!=(const TimestampVal &other) const
bool operator==(const SmallIntVal &other) const
int64_t time_of_day
Nanoseconds in current day.
bool operator==(const TimestampVal &other) const
bool operator!=(const BooleanVal &other) const
impala::FunctionContextImpl * impl()
TODO: Add mechanism for UDAs to update stats similar to runtime profile counters. ...
bool operator!=(const IntVal &other) const
void(* UdaUpdate)(FunctionContext *context, const InputType &input, IntermediateType *result)
const TypeDesc & GetReturnType() const
BooleanVal(bool val=false)
AnyVal(bool is_null=false)
void(* UdfPrepare)(FunctionContext *context, FunctionContext::FunctionStateScope scope)
bool operator!=(const DoubleVal &other) const
void(* UdaUpdate2)(FunctionContext *context, const InputType &input, const InputType2 &input2, IntermediateType *result)
bool has_error() const
Returns true if there's been an error set.
const IntermediateType(* UdaSerialize)(FunctionContext *context, const IntermediateType &type)
int32_t date
Gregorian date. This has the same binary format as boost::gregorian::date.
TimestampVal(int32_t date=0, int64_t time_of_day=0)
void(* UdaInit)(FunctionContext *context, IntermediateType *result)
This object has a compatible storage format with boost::ptime.
bool operator==(const StringVal &other) const
bool operator==(const BooleanVal &other) const
static SmallIntVal null()
ImpalaVersion version() const
Returns the version of Impala that's currently running.
bool AddWarning(const char *warning_msg)
DecimalVal(const DecimalVal &other)
StringVal(uint8_t *ptr=NULL, int len=0)
static TimestampVal null()
const TypeDesc * GetArgType(int arg_idx) const
FunctionContext & operator=(const FunctionContext &other)
bool operator==(const FloatVal &other) const
bool operator==(const DoubleVal &other) const
void * GetFunctionState(FunctionStateScope scope) const
bool operator!=(const TinyIntVal &other) const
void Free(uint8_t *buffer)
Frees a buffer returned from Allocate() or Reallocate()
bool IsArgConstant(int arg_idx) const
void SetFunctionState(FunctionStateScope scope, void *ptr)
impala::FunctionContextImpl * impl_
const char * error_msg() const
Returns the current error message. Returns NULL if there is no error.
StringVal(const char *ptr)
bool operator!=(const BigIntVal &other) const
const TypeDesc & GetIntermediateType() const
SmallIntVal(int16_t val=0)
uint8_t * Reallocate(uint8_t *ptr, int byte_size)
uint8_t * Allocate(int byte_size)
void TrackAllocation(int64_t byte_size)
bool operator==(const BigIntVal &other) const
ResultType(* UdaFinalize)(FunctionContext *context, const IntermediateType &v)
const char * user() const
int len
Only valid if type == TYPE_FIXED_BUFFER || type == TYPE_VARCHAR.
UniqueId query_id() const
Returns the query_id for the current query.
void SetError(const char *error_msg)
AnyVal * GetConstantArg(int arg_idx) const
void(* UdaMerge)(FunctionContext *context, const IntermediateType &src, IntermediateType *dst)
Merge an intermediate result 'src' into 'dst'.
bool operator==(const TinyIntVal &other) const
DecimalVal & operator=(const DecimalVal &other)
bool operator!=(const SmallIntVal &other) const
bool operator!=(const StringVal &other) const