9 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename OP>
10 static inline void operation(A_TYPE& a, B_TYPE& b, C_TYPE& c, RESULT_TYPE& result,
11 void* ,
void* ,
void* ) {
12 OP::operation(a, b, c, result);
17 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename OP>
18 static inline void operation(A_TYPE& a, B_TYPE& b, C_TYPE& c, RESULT_TYPE& result,
19 void* ,
void* resultValueVector,
void* ) {
25 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename OP>
26 static inline void operation(A_TYPE& a, B_TYPE& b, C_TYPE& c, RESULT_TYPE& result,
27 void* ,
void* resultValueVector,
void* dataPtr) {
33 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename OP>
34 static inline void operation(A_TYPE& a, B_TYPE& b, C_TYPE& c, RESULT_TYPE& result,
35 void* aValueVector,
void* resultValueVector,
void* ) {
42 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename OP>
43 static inline void operation(A_TYPE& a, B_TYPE& b, C_TYPE& c, RESULT_TYPE& result,
44 void* ,
void* ,
void* dataPtr) {
45 OP::operation(a, b, c, result, dataPtr);
50 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
54 uint64_t cPos, uint64_t resPos,
void* dataPtr) {
55 auto resValues = (RESULT_TYPE*)result.
getData();
56 OP_WRAPPER::template operation<A_TYPE, B_TYPE, C_TYPE, RESULT_TYPE, FUNC>(
58 ((C_TYPE*)c.
getData())[cPos], resValues[resPos], (
void*)&a, (
void*)&result, dataPtr);
61 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
65 auto aPos = a.
state->getSelVector()[0];
66 auto bPos = b.
state->getSelVector()[0];
67 auto cPos = c.
state->getSelVector()[0];
68 auto resPos = result.
state->getSelVector()[0];
70 if (!result.
isNull(resPos)) {
72 aPos, bPos, cPos, resPos, dataPtr);
76 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
80 auto aPos = a.
state->getSelVector()[0];
81 auto bPos = b.
state->getSelVector()[0];
82 auto& cSelVector = c.
state->getSelVector();
86 if (cSelVector.isUnfiltered()) {
87 for (
auto i = 0u; i < cSelVector.getSelSize(); ++i) {
89 result, aPos, bPos, i, i, dataPtr);
92 for (
auto i = 0u; i < cSelVector.getSelSize(); ++i) {
93 auto pos = cSelVector[i];
95 result, aPos, bPos, pos, pos, dataPtr);
99 if (cSelVector.isUnfiltered()) {
100 for (
auto i = 0u; i < cSelVector.getSelSize(); ++i) {
104 c, result, aPos, bPos, i, i, dataPtr);
108 for (
auto i = 0u; i < cSelVector.getSelSize(); ++i) {
109 auto pos = cSelVector[i];
111 if (!result.
isNull(pos)) {
113 c, result, aPos, bPos, pos, pos, dataPtr);
120 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
125 auto aPos = a.
state->getSelVector()[0];
126 auto& bSelVector = b.
state->getSelVector();
130 if (bSelVector.isUnfiltered()) {
131 for (
auto i = 0u; i < bSelVector.getSelSize(); ++i) {
133 result, aPos, i, i, i, dataPtr);
136 for (
auto i = 0u; i < bSelVector.getSelSize(); ++i) {
137 auto pos = bSelVector[i];
139 result, aPos, pos, pos, pos, dataPtr);
143 if (bSelVector.isUnfiltered()) {
144 for (
auto i = 0u; i < bSelVector.getSelSize(); ++i) {
148 c, result, aPos, i, i, i, dataPtr);
152 for (
auto i = 0u; i < bSelVector.getSelSize(); ++i) {
153 auto pos = bSelVector[i];
155 if (!result.
isNull(pos)) {
157 c, result, aPos, pos, pos, pos, dataPtr);
164 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
168 auto aPos = a.
state->getSelVector()[0];
169 auto cPos = c.
state->getSelVector()[0];
170 auto& bSelVector = b.
state->getSelVector();
174 if (bSelVector.isUnfiltered()) {
175 for (
auto i = 0u; i < bSelVector.getSelSize(); ++i) {
177 result, aPos, i, cPos, i, dataPtr);
180 for (
auto i = 0u; i < bSelVector.getSelSize(); ++i) {
181 auto pos = bSelVector[i];
183 result, aPos, pos, cPos, pos, dataPtr);
187 if (bSelVector.isUnfiltered()) {
188 for (
auto i = 0u; i < bSelVector.getSelSize(); ++i) {
192 c, result, aPos, i, cPos, i, dataPtr);
196 for (
auto i = 0u; i < bSelVector.getSelSize(); ++i) {
197 auto pos = bSelVector[i];
199 if (!result.
isNull(pos)) {
201 c, result, aPos, pos, cPos, pos, dataPtr);
208 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
213 auto& aSelVector = a.
state->getSelVector();
215 if (aSelVector.isUnfiltered()) {
216 for (uint64_t i = 0; i < aSelVector.getSelSize(); i++) {
218 result, i, i, i, i, dataPtr);
221 for (uint64_t i = 0; i < aSelVector.getSelSize(); i++) {
222 auto pos = aSelVector[i];
224 result, pos, pos, pos, pos, dataPtr);
228 if (aSelVector.isUnfiltered()) {
229 for (uint64_t i = 0; i < aSelVector.getSelSize(); i++) {
233 c, result, i, i, i, i, dataPtr);
237 for (uint64_t i = 0; i < aSelVector.getSelSize(); i++) {
238 auto pos = aSelVector[i];
240 if (!result.
isNull(pos)) {
242 c, result, pos, pos, pos, pos, dataPtr);
249 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
253 auto bPos = b.
state->getSelVector()[0];
254 auto cPos = c.
state->getSelVector()[0];
255 auto& aSelVector = a.
state->getSelVector();
259 if (aSelVector.isUnfiltered()) {
260 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
262 result, i, bPos, cPos, i, dataPtr);
265 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
266 auto pos = aSelVector[i];
268 result, pos, bPos, cPos, pos, dataPtr);
272 if (aSelVector.isUnfiltered()) {
273 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
277 c, result, i, bPos, cPos, i, dataPtr);
281 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
282 auto pos = aSelVector[i];
284 if (!result.
isNull(pos)) {
286 c, result, pos, bPos, cPos, pos, dataPtr);
293 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
298 auto& aSelVector = a.
state->getSelVector();
299 auto bPos = b.
state->getSelVector()[0];
303 if (aSelVector.isUnfiltered()) {
304 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
306 result, i, bPos, i, i, dataPtr);
309 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
310 auto pos = aSelVector[i];
312 result, pos, bPos, pos, pos, dataPtr);
316 if (aSelVector.isUnfiltered()) {
317 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
321 c, result, i, bPos, i, i, dataPtr);
325 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
326 auto pos = b.
state->getSelVector()[i];
328 if (!result.
isNull(pos)) {
330 c, result, pos, bPos, pos, pos, dataPtr);
337 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
342 auto& aSelVector = a.
state->getSelVector();
343 auto cPos = c.
state->getSelVector()[0];
347 if (aSelVector.isUnfiltered()) {
348 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
350 result, i, i, cPos, i, dataPtr);
353 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
354 auto pos = aSelVector[i];
356 result, pos, pos, cPos, pos, dataPtr);
360 if (aSelVector.isUnfiltered()) {
361 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
365 c, result, i, i, cPos, i, dataPtr);
369 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
370 auto pos = aSelVector[i];
372 if (!result.
isNull(pos)) {
374 c, result, pos, pos, cPos, pos, dataPtr);
381 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
389 }
else if (a.
state->isFlat() && b.
state->isFlat() && !c.
state->isFlat()) {
392 }
else if (a.
state->isFlat() && !b.
state->isFlat() && !c.
state->isFlat()) {
395 }
else if (a.
state->isFlat() && !b.
state->isFlat() && c.
state->isFlat()) {
398 }
else if (!a.
state->isFlat() && !b.
state->isFlat() && !c.
state->isFlat()) {
401 }
else if (!a.
state->isFlat() && !b.
state->isFlat() && c.
state->isFlat()) {
404 }
else if (!a.
state->isFlat() && b.
state->isFlat() && c.
state->isFlat()) {
407 }
else if (!a.
state->isFlat() && b.
state->isFlat() && !c.
state->isFlat()) {
415 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC>
422 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC>
426 c, result,
nullptr );
429 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC>
436 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC>
440 c, result,
nullptr );
443 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC>
#define KU_ASSERT(condition)
Definition assert.h:19
Definition value_vector.h:20
uint8_t * getData() const
Definition value_vector.h:83
void resetAuxiliaryBuffer()
uint8_t isNull(uint32_t pos) const
Definition value_vector.h:48
bool hasNoNullsGuarantee() const
Definition value_vector.h:42
void setAllNull()
Definition value_vector.h:39
void setNull(uint32_t pos, bool isNull)
std::shared_ptr< DataChunkState > state
Definition value_vector.h:106
Definition array_utils.h:7
Definition ternary_function_executor.h:49
static void executeAllUnFlat(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:210
static void executeSwitch(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:383
static void executeString(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result)
Definition ternary_function_executor.h:423
static void executeOnValue(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, uint64_t aPos, uint64_t bPos, uint64_t cPos, uint64_t resPos, void *dataPtr)
Definition ternary_function_executor.h:52
static void executeFlatFlatUnflat(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:78
static void executeListStruct(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result)
Definition ternary_function_executor.h:437
static void executeUnflatFlatFlat(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:251
static void executeUDF(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:444
static void executeRegex(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:430
static void execute(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result)
Definition ternary_function_executor.h:416
static void executeFlatUnflatFlat(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:166
static void executeAllFlat(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:63
static void executeUnflatUnFlatFlat(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:339
static void executeUnflatFlatUnflat(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:295
static void executeFlatUnflatUnflat(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:122
Definition ternary_function_executor.h:8
static void operation(A_TYPE &a, B_TYPE &b, C_TYPE &c, RESULT_TYPE &result, void *, void *, void *)
Definition ternary_function_executor.h:10
Definition ternary_function_executor.h:32
static void operation(A_TYPE &a, B_TYPE &b, C_TYPE &c, RESULT_TYPE &result, void *aValueVector, void *resultValueVector, void *)
Definition ternary_function_executor.h:34
Definition ternary_function_executor.h:24
static void operation(A_TYPE &a, B_TYPE &b, C_TYPE &c, RESULT_TYPE &result, void *, void *resultValueVector, void *dataPtr)
Definition ternary_function_executor.h:26
Definition ternary_function_executor.h:16
static void operation(A_TYPE &a, B_TYPE &b, C_TYPE &c, RESULT_TYPE &result, void *, void *resultValueVector, void *)
Definition ternary_function_executor.h:18
Definition ternary_function_executor.h:41
static void operation(A_TYPE &a, B_TYPE &b, C_TYPE &c, RESULT_TYPE &result, void *, void *, void *dataPtr)
Definition ternary_function_executor.h:43