Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
uda-sample.h
Go to the documentation of this file.
1 // Copyright 2012 Cloudera Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 
16 #ifndef IMPALA_UDF_SAMPLE_UDA_H
17 #define IMPALA_UDF_SAMPLE_UDA_H
18 
19 #include <udf/udf.h>
20 
21 using namespace impala_udf;
22 
24 void CountInit(FunctionContext* context, BigIntVal* val);
25 void CountUpdate(FunctionContext* context, const IntVal& input, BigIntVal* val);
26 void CountMerge(FunctionContext* context, const BigIntVal& src, BigIntVal* dst);
27 BigIntVal CountFinalize(FunctionContext* context, const BigIntVal& val);
28 
33 void AvgInit(FunctionContext* context, BufferVal* val);
34 void AvgUpdate(FunctionContext* context, const DoubleVal& input, BufferVal* val);
35 void AvgMerge(FunctionContext* context, const BufferVal& src, BufferVal* dst);
36 DoubleVal AvgFinalize(FunctionContext* context, const BufferVal& val);
37 
40 void StringConcatInit(FunctionContext* context, StringVal* val);
41 void StringConcatUpdate(FunctionContext* context, const StringVal& arg1,
42  const StringVal& arg2, StringVal* val);
43 void StringConcatMerge(FunctionContext* context, const StringVal& src, StringVal* dst);
45 
46 #endif
void AvgMerge(FunctionContext *context, const BufferVal &src, BufferVal *dst)
Definition: uda-sample.cc:61
DoubleVal AvgFinalize(FunctionContext *context, const BufferVal &val)
Definition: uda-sample.cc:69
void StringConcatMerge(FunctionContext *context, const StringVal &src, StringVal *dst)
Definition: uda-sample.cc:99
void CountUpdate(FunctionContext *context, const IntVal &input, BigIntVal *val)
Definition: uda-test.cc:39
void AvgUpdate(FunctionContext *context, const DoubleVal &input, BufferVal *val)
Definition: uda-sample.cc:54
void CountInit(FunctionContext *context, BigIntVal *val)
This is an example of the COUNT aggregate function.
Definition: uda-test.cc:34
BigIntVal CountFinalize(FunctionContext *context, const BigIntVal &val)
Definition: uda-test.cc:49
void CountMerge(FunctionContext *context, const BigIntVal &src, BigIntVal *dst)
Definition: uda-test.cc:45
uint8_t * BufferVal
Definition: udf.h:600
StringVal StringConcatFinalize(FunctionContext *context, const StringVal &val)
Definition: uda-sample.cc:104
void StringConcatUpdate(FunctionContext *context, const StringVal &arg1, const StringVal &arg2, StringVal *val)
Definition: uda-sample.cc:83
void StringConcatInit(FunctionContext *context, StringVal *val)
Definition: uda-sample.cc:79
void AvgInit(FunctionContext *context, BufferVal *val)
Definition: uda-sample.cc:49