Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
operators.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 #ifndef IMPALA_EXPRS_OPERATORS_H
16 #define IMPALA_EXPRS_OPERATORS_H
17 
18 #include "udf/udf.h"
19 
20 using namespace impala_udf;
21 
22 namespace impala {
23 
25 class Operators {
26  public:
27  static TinyIntVal Bitnot_TinyIntVal(FunctionContext*, const TinyIntVal&);
28  static SmallIntVal Bitnot_SmallIntVal(FunctionContext*, const SmallIntVal&);
29  static IntVal Bitnot_IntVal(FunctionContext*, const IntVal&);
30  static BigIntVal Bitnot_BigIntVal(FunctionContext*, const BigIntVal&);
31 
32  static TinyIntVal Add_TinyIntVal_TinyIntVal(
33  FunctionContext*, const TinyIntVal&, const TinyIntVal&);
34  static SmallIntVal Add_SmallIntVal_SmallIntVal(
35  FunctionContext*, const SmallIntVal&, const SmallIntVal&);
36  static IntVal Add_IntVal_IntVal(FunctionContext*, const IntVal&, const IntVal&);
37  static BigIntVal Add_BigIntVal_BigIntVal(
38  FunctionContext*, const BigIntVal&, const BigIntVal&);
39  static FloatVal Add_FloatVal_FloatVal(
40  FunctionContext*, const FloatVal&, const FloatVal&);
41  static DoubleVal Add_DoubleVal_DoubleVal(
42  FunctionContext*, const DoubleVal&, const DoubleVal&);
43 
44  static TinyIntVal Subtract_TinyIntVal_TinyIntVal(
45  FunctionContext*, const TinyIntVal&, const TinyIntVal&);
46  static SmallIntVal Subtract_SmallIntVal_SmallIntVal(
47  FunctionContext*, const SmallIntVal&, const SmallIntVal&);
48  static IntVal Subtract_IntVal_IntVal(FunctionContext*, const IntVal&, const IntVal&);
49  static BigIntVal Subtract_BigIntVal_BigIntVal(
50  FunctionContext*, const BigIntVal&, const BigIntVal&);
51  static FloatVal Subtract_FloatVal_FloatVal(
52  FunctionContext*, const FloatVal&, const FloatVal&);
53  static DoubleVal Subtract_DoubleVal_DoubleVal(
54  FunctionContext*, const DoubleVal&, const DoubleVal&);
55 
56  static TinyIntVal Multiply_TinyIntVal_TinyIntVal(
57  FunctionContext*, const TinyIntVal&, const TinyIntVal&);
58  static SmallIntVal Multiply_SmallIntVal_SmallIntVal(
59  FunctionContext*, const SmallIntVal&, const SmallIntVal&);
60  static IntVal Multiply_IntVal_IntVal(FunctionContext*, const IntVal&, const IntVal&);
61  static BigIntVal Multiply_BigIntVal_BigIntVal(
62  FunctionContext*, const BigIntVal&, const BigIntVal&);
63  static FloatVal Multiply_FloatVal_FloatVal(
64  FunctionContext*, const FloatVal&, const FloatVal&);
65  static DoubleVal Multiply_DoubleVal_DoubleVal(
66  FunctionContext*, const DoubleVal&, const DoubleVal&);
67 
68  static DoubleVal Divide_DoubleVal_DoubleVal(
69  FunctionContext*, const DoubleVal&, const DoubleVal&);
70 
71  static TinyIntVal Int_divide_TinyIntVal_TinyIntVal(
72  FunctionContext*, const TinyIntVal&, const TinyIntVal&);
73  static SmallIntVal Int_divide_SmallIntVal_SmallIntVal(
74  FunctionContext*, const SmallIntVal&, const SmallIntVal&);
75  static IntVal Int_divide_IntVal_IntVal(FunctionContext*, const IntVal&, const IntVal&);
76  static BigIntVal Int_divide_BigIntVal_BigIntVal(
77  FunctionContext*, const BigIntVal&, const BigIntVal&);
78 
79  static TinyIntVal Mod_TinyIntVal_TinyIntVal(
80  FunctionContext*, const TinyIntVal&, const TinyIntVal&);
81  static SmallIntVal Mod_SmallIntVal_SmallIntVal(
82  FunctionContext*, const SmallIntVal&, const SmallIntVal&);
83  static IntVal Mod_IntVal_IntVal(FunctionContext*, const IntVal&, const IntVal&);
84  static BigIntVal Mod_BigIntVal_BigIntVal(
85  FunctionContext*, const BigIntVal&, const BigIntVal&);
86 
87  static TinyIntVal Bitand_TinyIntVal_TinyIntVal(
88  FunctionContext*, const TinyIntVal&, const TinyIntVal&);
89  static SmallIntVal Bitand_SmallIntVal_SmallIntVal(
90  FunctionContext*, const SmallIntVal&, const SmallIntVal&);
91  static IntVal Bitand_IntVal_IntVal(FunctionContext*, const IntVal&, const IntVal&);
92  static BigIntVal Bitand_BigIntVal_BigIntVal(
93  FunctionContext*, const BigIntVal&, const BigIntVal&);
94 
95  static TinyIntVal Bitxor_TinyIntVal_TinyIntVal(
96  FunctionContext*, const TinyIntVal&, const TinyIntVal&);
97  static SmallIntVal Bitxor_SmallIntVal_SmallIntVal(
98  FunctionContext*, const SmallIntVal&, const SmallIntVal&);
99  static IntVal Bitxor_IntVal_IntVal(FunctionContext*, const IntVal&, const IntVal&);
100  static BigIntVal Bitxor_BigIntVal_BigIntVal(
101  FunctionContext*, const BigIntVal&, const BigIntVal&);
102 
103  static TinyIntVal Bitor_TinyIntVal_TinyIntVal(
104  FunctionContext*, const TinyIntVal&, const TinyIntVal&);
105  static SmallIntVal Bitor_SmallIntVal_SmallIntVal(
106  FunctionContext*, const SmallIntVal&, const SmallIntVal&);
107  static IntVal Bitor_IntVal_IntVal(FunctionContext*, const IntVal&, const IntVal&);
108  static BigIntVal Bitor_BigIntVal_BigIntVal(
109  FunctionContext*, const BigIntVal&, const BigIntVal&);
110 
111  static BooleanVal Eq_BooleanVal_BooleanVal(
112  FunctionContext*, const BooleanVal&, const BooleanVal&);
113  static BooleanVal Eq_TinyIntVal_TinyIntVal(
114  FunctionContext*, const TinyIntVal&, const TinyIntVal&);
115  static BooleanVal Eq_SmallIntVal_SmallIntVal(
116  FunctionContext*, const SmallIntVal&, const SmallIntVal&);
117  static BooleanVal Eq_IntVal_IntVal(FunctionContext*, const IntVal&, const IntVal&);
118  static BooleanVal Eq_BigIntVal_BigIntVal(
119  FunctionContext*, const BigIntVal&, const BigIntVal&);
120  static BooleanVal Eq_FloatVal_FloatVal(
121  FunctionContext*, const FloatVal&, const FloatVal&);
122  static BooleanVal Eq_DoubleVal_DoubleVal(
123  FunctionContext*, const DoubleVal&, const DoubleVal&);
124  static BooleanVal Eq_StringVal_StringVal(
125  FunctionContext*, const StringVal&, const StringVal&);
126  static BooleanVal Eq_Char_Char(FunctionContext*, const StringVal&, const StringVal&);
127  static BooleanVal Eq_TimestampVal_TimestampVal(
128  FunctionContext*, const TimestampVal&, const TimestampVal&);
129 
130  static BooleanVal Ne_BooleanVal_BooleanVal(
131  FunctionContext*, const BooleanVal&, const BooleanVal&);
132  static BooleanVal Ne_TinyIntVal_TinyIntVal(
133  FunctionContext*, const TinyIntVal&, const TinyIntVal&);
134  static BooleanVal Ne_SmallIntVal_SmallIntVal(
135  FunctionContext*, const SmallIntVal&, const SmallIntVal&);
136  static BooleanVal Ne_IntVal_IntVal(FunctionContext*, const IntVal&, const IntVal&);
137  static BooleanVal Ne_BigIntVal_BigIntVal(
138  FunctionContext*, const BigIntVal&, const BigIntVal&);
139  static BooleanVal Ne_FloatVal_FloatVal(
140  FunctionContext*, const FloatVal&, const FloatVal&);
141  static BooleanVal Ne_DoubleVal_DoubleVal(
142  FunctionContext*, const DoubleVal&, const DoubleVal&);
143  static BooleanVal Ne_StringVal_StringVal(
144  FunctionContext*, const StringVal&, const StringVal&);
145  static BooleanVal Ne_Char_Char(FunctionContext*, const StringVal&, const StringVal&);
146  static BooleanVal Ne_TimestampVal_TimestampVal(
147  FunctionContext*, const TimestampVal&, const TimestampVal&);
148 
149  static BooleanVal Gt_BooleanVal_BooleanVal(
150  FunctionContext*, const BooleanVal&, const BooleanVal&);
151  static BooleanVal Gt_TinyIntVal_TinyIntVal(
152  FunctionContext*, const TinyIntVal&, const TinyIntVal&);
153  static BooleanVal Gt_SmallIntVal_SmallIntVal(
154  FunctionContext*, const SmallIntVal&, const SmallIntVal&);
155  static BooleanVal Gt_IntVal_IntVal(FunctionContext*, const IntVal&, const IntVal&);
156  static BooleanVal Gt_BigIntVal_BigIntVal(
157  FunctionContext*, const BigIntVal&, const BigIntVal&);
158  static BooleanVal Gt_FloatVal_FloatVal(
159  FunctionContext*, const FloatVal&, const FloatVal&);
160  static BooleanVal Gt_DoubleVal_DoubleVal(
161  FunctionContext*, const DoubleVal&, const DoubleVal&);
162  static BooleanVal Gt_StringVal_StringVal(
163  FunctionContext*, const StringVal&, const StringVal&);
164  static BooleanVal Gt_Char_Char(FunctionContext*, const StringVal&, const StringVal&);
165  static BooleanVal Gt_TimestampVal_TimestampVal(
166  FunctionContext*, const TimestampVal&, const TimestampVal&);
167 
168  static BooleanVal Lt_BooleanVal_BooleanVal(
169  FunctionContext*, const BooleanVal&, const BooleanVal&);
170  static BooleanVal Lt_TinyIntVal_TinyIntVal(
171  FunctionContext*, const TinyIntVal&, const TinyIntVal&);
172  static BooleanVal Lt_SmallIntVal_SmallIntVal(
173  FunctionContext*, const SmallIntVal&, const SmallIntVal&);
174  static BooleanVal Lt_IntVal_IntVal(FunctionContext*, const IntVal&, const IntVal&);
175  static BooleanVal Lt_BigIntVal_BigIntVal(
176  FunctionContext*, const BigIntVal&, const BigIntVal&);
177  static BooleanVal Lt_FloatVal_FloatVal(
178  FunctionContext*, const FloatVal&, const FloatVal&);
179  static BooleanVal Lt_DoubleVal_DoubleVal(
180  FunctionContext*, const DoubleVal&, const DoubleVal&);
181  static BooleanVal Lt_StringVal_StringVal(
182  FunctionContext*, const StringVal&, const StringVal&);
183  static BooleanVal Lt_Char_Char(FunctionContext*, const StringVal&, const StringVal&);
184  static BooleanVal Lt_TimestampVal_TimestampVal(
185  FunctionContext*, const TimestampVal&, const TimestampVal&);
186 
187  static BooleanVal Ge_BooleanVal_BooleanVal(
188  FunctionContext*, const BooleanVal&, const BooleanVal&);
189  static BooleanVal Ge_TinyIntVal_TinyIntVal(
190  FunctionContext*, const TinyIntVal&, const TinyIntVal&);
191  static BooleanVal Ge_SmallIntVal_SmallIntVal(
192  FunctionContext*, const SmallIntVal&, const SmallIntVal&);
193  static BooleanVal Ge_IntVal_IntVal(FunctionContext*, const IntVal&, const IntVal&);
194  static BooleanVal Ge_BigIntVal_BigIntVal(
195  FunctionContext*, const BigIntVal&, const BigIntVal&);
196  static BooleanVal Ge_FloatVal_FloatVal(
197  FunctionContext*, const FloatVal&, const FloatVal&);
198  static BooleanVal Ge_DoubleVal_DoubleVal(
199  FunctionContext*, const DoubleVal&, const DoubleVal&);
200  static BooleanVal Ge_StringVal_StringVal(
201  FunctionContext*, const StringVal&, const StringVal&);
202  static BooleanVal Ge_Char_Char( FunctionContext*, const StringVal&, const StringVal&);
203  static BooleanVal Ge_TimestampVal_TimestampVal(
204  FunctionContext*, const TimestampVal&, const TimestampVal&);
205 
206  static BooleanVal Le_BooleanVal_BooleanVal(
207  FunctionContext*, const BooleanVal&, const BooleanVal&);
208  static BooleanVal Le_TinyIntVal_TinyIntVal(
209  FunctionContext*, const TinyIntVal&, const TinyIntVal&);
210  static BooleanVal Le_SmallIntVal_SmallIntVal(
211  FunctionContext*, const SmallIntVal&, const SmallIntVal&);
212  static BooleanVal Le_IntVal_IntVal(FunctionContext*, const IntVal&, const IntVal&);
213  static BooleanVal Le_BigIntVal_BigIntVal(
214  FunctionContext*, const BigIntVal&, const BigIntVal&);
215  static BooleanVal Le_FloatVal_FloatVal(
216  FunctionContext*, const FloatVal&, const FloatVal&);
217  static BooleanVal Le_DoubleVal_DoubleVal(
218  FunctionContext*, const DoubleVal&, const DoubleVal&);
219  static BooleanVal Le_StringVal_StringVal(
220  FunctionContext*, const StringVal&, const StringVal&);
221  static BooleanVal Le_Char_Char(FunctionContext*, const StringVal&, const StringVal&);
222  static BooleanVal Le_TimestampVal_TimestampVal(
223  FunctionContext*, const TimestampVal&, const TimestampVal&);
224 };
225 
226 } // namespace impala
227 #endif
228 
This object has a compatible storage format with boost::ptime.
Definition: udf.h:495
Operators written against the UDF interface.
Definition: operators.h:25