uda-sample.cc
// Initialize the StringVal intermediate to a zero'd AvgStruct
Initialize the StringVal intermediate to a zero'd AvgStruct
Initialize the StringVal intermediate to a zero ' d AvgStruct
void AvgInit(FunctionContext* context, StringVal* val) {
  val->ptr = context->Allocate(sizeof(AvgStruct));
  if (val->ptr == NULL) {
    *val = StringVal::null();
    return;
  }
  val->is_null = false;
  val->len = sizeof(AvgStruct);
  memset(val->ptr, 0, val->len);
}
void AvgInit ( FunctionContext * context , StringVal * val ) { val -> ptr = context -> Allocate ( sizeof ( AvgStruct ) ) ; if ( val -> ptr == NULL ) { * val = StringVal :: null ( ) ; return ; } val -> is_null = false ; val -> len = sizeof ( AvgStruct ) ; memset ( val -> ptr , 0 , val -> len ) ; }
Initialize the StringVal intermediate to a zero'd AvgStruct
Initialize the StringVal intermediate to a zero ' d AvgStruct
// Exit on failed allocation. Impala will fail the query after some time.