16 #ifndef IMPALA_UDF_UDF_INTERNAL_H
17 #define IMPALA_UDF_UDF_INTERNAL_H
19 #include <boost/cstdint.hpp>
43 const std::vector<impala_udf::FunctionContext::TypeDesc>& arg_types,
44 int varargs_buffer_size = 0,
bool debug =
false);
51 const std::vector<impala_udf::FunctionContext::TypeDesc>& arg_types,
52 int varargs_buffer_size = 0,
bool debug =
false);
77 void SetConstantArgs(
const std::vector<impala_udf::AnyVal*>& constant_args);
156 std::vector<impala_udf::FunctionContext::TypeDesc>
arg_types_;
impala_udf::FunctionContext::ImpalaVersion version_
uint8_t * varargs_buffer()
impala_udf::FunctionContext::TypeDesc intermediate_type_
Type descriptor for the intermediate type of a UDA. Set to INVALID_TYPE for UDFs. ...
std::vector< impala_udf::FunctionContext::TypeDesc > arg_types_
Type descriptors for each argument of the function.
int64_t num_warnings_
The number of warnings reported.
void * thread_local_fn_state_
The function state accessed via FunctionContext::Get/SetFunctionState()
void SetConstantArgs(const std::vector< impala_udf::AnyVal * > &constant_args)
Sets constant_args_. The AnyVal* values are owned by the caller.
int64_t external_bytes_tracked_
impala_udf::FunctionContext * context_
Parent context object. Not owned.
FreePool * pool_
Pool to service allocations from.
int64_t num_updates() const
std::vector< impala_udf::AnyVal * > staging_input_vals_
std::string error_msg_
Empty if there's no error.
std::map< uint8_t *, int > allocations_
void IncrementNumUpdates(int64_t n=1)
std::vector< uint8_t * > local_allocations_
Allocations owned by Impala.
impala_udf::FunctionContext::TypeDesc return_type_
Type descriptor for the return type of the function.
bool closed_
Indicates whether this context has been closed. Used for verification/debugging.
static const char * LLVM_FUNCTIONCONTEXT_NAME
std::vector< impala_udf::AnyVal * > constant_args_
void set_num_removes(int64_t n)
void set_num_updates(int64_t n)
bool debug_
If true, indicates this is a debug context which will do additional validation.
int64_t num_removes() const
impala_udf::FunctionContext * Clone(MemPool *pool)
FunctionContextImpl(impala_udf::FunctionContext *parent)
static impala_udf::FunctionContext * CreateContext(RuntimeState *state, MemPool *pool, const impala_udf::FunctionContext::TypeDesc &return_type, const std::vector< impala_udf::FunctionContext::TypeDesc > &arg_types, int varargs_buffer_size=0, bool debug=false)
Create a FunctionContext for a UDF. Caller is responsible for deleting it.
void * fragment_local_fn_state_
uint8_t * AllocateLocal(int byte_size)
void FreeLocalAllocations()
Frees all allocations returned by AllocateLocal().
void IncrementNumRemoves(int64_t n=1)
int64_t num_updates_
The number of calls to Update()/Remove().
std::vector< impala_udf::AnyVal * > * staging_input_vals()
uint8_t * varargs_buffer_