14 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename OP>
15 static inline void operation(LEFT_TYPE& left, RIGHT_TYPE& right, RESULT_TYPE& result,
18 OP::operation(left, right, result);
23 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename OP>
24 static void operation(LEFT_TYPE& left, RIGHT_TYPE& right, RESULT_TYPE& result,
27 OP::operation(left, right, result, *leftValueVector, *rightValueVector, *resultValueVector);
32 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename OP>
33 static void operation(LEFT_TYPE& left, RIGHT_TYPE& right, RESULT_TYPE& result,
36 OP::operation(left, right, result, *leftValueVector, *rightValueVector, *resultValueVector,
42 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename OP>
43 static inline void operation(LEFT_TYPE& left, RIGHT_TYPE& right, RESULT_TYPE& result,
46 OP::operation(left, right, result, *leftValueVector, *rightValueVector, *resultValueVector,
52 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename OP>
53 static inline void operation(LEFT_TYPE& left, RIGHT_TYPE& right, RESULT_TYPE& result,
56 OP::operation(left, right, result, *resultValueVector);
61 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename OP>
62 static inline void operation(LEFT_TYPE& left, RIGHT_TYPE& right, RESULT_TYPE& result,
65 OP::operation(left, right, result, leftValueVector, rightValueVector);
70 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename OP>
71 static inline void operation(LEFT_TYPE& left, RIGHT_TYPE& right, RESULT_TYPE& result,
74 OP::operation(left, right, result, dataPtr);
79 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC,
84 OP_WRAPPER::template operation<LEFT_TYPE, RIGHT_TYPE, RESULT_TYPE, FUNC>(
85 ((LEFT_TYPE*)left.
getData())[lPos], ((RIGHT_TYPE*)right.
getData())[rPos],
86 ((RESULT_TYPE*)resultValueVector.
getData())[resPos], &left, &right, &resultValueVector,
90 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC,
94 auto lPos = left.
state->getSelVector()[0];
95 auto rPos = right.
state->getSelVector()[0];
96 auto resPos = result.
state->getSelVector()[0];
98 if (!result.
isNull(resPos)) {
100 result, lPos, rPos, resPos, dataPtr);
104 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC,
108 auto lPos = left.
state->getSelVector()[0];
109 auto& rightSelVector = right.
state->getSelVector();
113 if (rightSelVector.isUnfiltered()) {
114 for (
auto i = 0u; i < rightSelVector.getSelSize(); ++i) {
116 right, result, lPos, i, i, dataPtr);
119 for (
auto i = 0u; i < rightSelVector.getSelSize(); ++i) {
120 auto rPos = rightSelVector[i];
122 right, result, lPos, rPos, rPos, dataPtr);
126 if (rightSelVector.isUnfiltered()) {
127 for (
auto i = 0u; i < rightSelVector.getSelSize(); ++i) {
131 right, result, lPos, i, i, dataPtr);
135 for (
auto i = 0u; i < rightSelVector.getSelSize(); ++i) {
136 auto rPos = rightSelVector[i];
138 if (!result.
isNull(rPos)) {
140 right, result, lPos, rPos, rPos, dataPtr);
147 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC,
151 auto rPos = right.
state->getSelVector()[0];
152 auto& leftSelVector = left.
state->getSelVector();
156 if (leftSelVector.isUnfiltered()) {
157 for (
auto i = 0u; i < leftSelVector.getSelSize(); ++i) {
159 right, result, i, rPos, i, dataPtr);
162 for (
auto i = 0u; i < leftSelVector.getSelSize(); ++i) {
163 auto lPos = leftSelVector[i];
165 right, result, lPos, rPos, lPos, dataPtr);
169 if (leftSelVector.isUnfiltered()) {
170 for (
auto i = 0u; i < leftSelVector.getSelSize(); ++i) {
174 right, result, i, rPos, i, dataPtr);
178 for (
auto i = 0u; i < leftSelVector.getSelSize(); ++i) {
179 auto lPos = leftSelVector[i];
181 if (!result.
isNull(lPos)) {
183 right, result, lPos, rPos, lPos, dataPtr);
190 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC,
195 auto& resultSelVector = result.
state->getSelVector();
197 if (resultSelVector.isUnfiltered()) {
198 for (uint64_t i = 0; i < resultSelVector.getSelSize(); i++) {
200 right, result, i, i, i, dataPtr);
203 for (uint64_t i = 0; i < resultSelVector.getSelSize(); i++) {
204 auto pos = resultSelVector[i];
206 right, result, pos, pos, pos, dataPtr);
210 if (resultSelVector.isUnfiltered()) {
211 for (uint64_t i = 0; i < resultSelVector.getSelSize(); i++) {
215 right, result, i, i, i, dataPtr);
219 for (uint64_t i = 0; i < resultSelVector.getSelSize(); i++) {
220 auto pos = resultSelVector[i];
222 if (!result.
isNull(pos)) {
224 right, result, pos, pos, pos, dataPtr);
231 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC,
236 if (left.
state->isFlat() && right.
state->isFlat()) {
239 }
else if (left.
state->isFlat() && !right.
state->isFlat()) {
242 }
else if (!left.
state->isFlat() && right.
state->isFlat()) {
245 }
else if (!left.
state->isFlat() && !right.
state->isFlat()) {
253 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC>
260 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC>
264 right, result,
nullptr );
267 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC>
271 left, right, result,
nullptr );
274 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC>
278 left, right, result, dataPtr);
281 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC>
285 left, right, result,
nullptr );
288 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC>
292 left, right, result,
nullptr );
295 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC>
299 right, result, dataPtr);
303 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename OP>
304 static inline void operation(LEFT_TYPE& left, RIGHT_TYPE& right, uint8_t& result,
306 OP::operation(left, right, result);
311 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename OP>
312 static inline void operation(LEFT_TYPE& left, RIGHT_TYPE& right, uint8_t& result,
314 OP::operation(left, right, result, leftValueVector, rightValueVector);
318 template<
class LEFT_TYPE,
class RIGHT_TYPE,
class FUNC,
typename SELECT_WRAPPER>
320 uint64_t rPos, uint64_t resPos, uint64_t& numSelectedValues,
321 std::span<common::sel_t> selectedPositionsBuffer) {
322 uint8_t resultValue = 0;
323 SELECT_WRAPPER::template operation<LEFT_TYPE, RIGHT_TYPE, FUNC>(
324 ((LEFT_TYPE*)left.
getData())[lPos], ((RIGHT_TYPE*)right.
getData())[rPos], resultValue,
326 selectedPositionsBuffer[numSelectedValues] = resPos;
327 numSelectedValues += (resultValue ==
true);
330 template<
class LEFT_TYPE,
class RIGHT_TYPE,
class FUNC,
typename SELECT_WRAPPER>
332 auto lPos = left.
state->getSelVector()[0];
333 auto rPos = right.
state->getSelVector()[0];
334 uint8_t resultValue = 0;
336 SELECT_WRAPPER::template operation<LEFT_TYPE, RIGHT_TYPE, FUNC>(
337 ((LEFT_TYPE*)left.
getData())[lPos], ((RIGHT_TYPE*)right.
getData())[rPos],
338 resultValue, &left, &right);
340 return resultValue ==
true;
343 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename FUNC,
typename SELECT_WRAPPER>
346 auto lPos = left.
state->getSelVector()[0];
347 uint64_t numSelectedValues = 0;
349 auto& rightSelVector = right.
state->getSelVector();
351 return numSelectedValues;
353 if (rightSelVector.isUnfiltered()) {
354 for (
auto i = 0u; i < rightSelVector.getSelSize(); ++i) {
356 i, numSelectedValues, selectedPositionsBuffer);
359 for (
auto i = 0u; i < rightSelVector.getSelSize(); ++i) {
360 auto rPos = rightSelVector[i];
362 rPos, rPos, numSelectedValues, selectedPositionsBuffer);
366 if (rightSelVector.isUnfiltered()) {
367 for (
auto i = 0u; i < rightSelVector.getSelSize(); ++i) {
370 lPos, i, i, numSelectedValues, selectedPositionsBuffer);
374 for (
auto i = 0u; i < rightSelVector.getSelSize(); ++i) {
375 auto rPos = rightSelVector[i];
376 if (!right.
isNull(rPos)) {
378 lPos, rPos, rPos, numSelectedValues, selectedPositionsBuffer);
384 return numSelectedValues > 0;
387 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename FUNC,
typename SELECT_WRAPPER>
390 auto rPos = right.
state->getSelVector()[0];
391 uint64_t numSelectedValues = 0;
393 auto& leftSelVector = left.
state->getSelVector();
395 return numSelectedValues;
397 if (leftSelVector.isUnfiltered()) {
398 for (
auto i = 0u; i < leftSelVector.getSelSize(); ++i) {
400 i, numSelectedValues, selectedPositionsBuffer);
403 for (
auto i = 0u; i < leftSelVector.getSelSize(); ++i) {
404 auto lPos = leftSelVector[i];
406 rPos, lPos, numSelectedValues, selectedPositionsBuffer);
410 if (leftSelVector.isUnfiltered()) {
411 for (
auto i = 0u; i < leftSelVector.getSelSize(); ++i) {
414 rPos, i, numSelectedValues, selectedPositionsBuffer);
418 for (
auto i = 0u; i < leftSelVector.getSelSize(); ++i) {
419 auto lPos = leftSelVector[i];
422 lPos, rPos, lPos, numSelectedValues, selectedPositionsBuffer);
428 return numSelectedValues > 0;
432 template<
class LEFT_TYPE,
class RIGHT_TYPE,
class FUNC,
typename SELECT_WRAPPER>
435 uint64_t numSelectedValues = 0;
437 auto& leftSelVector = left.
state->getSelVector();
439 if (leftSelVector.isUnfiltered()) {
440 for (
auto i = 0u; i < leftSelVector.getSelSize(); i++) {
442 numSelectedValues, selectedPositionsBuffer);
445 for (
auto i = 0u; i < leftSelVector.getSelSize(); i++) {
446 auto pos = leftSelVector[i];
448 pos, pos, numSelectedValues, selectedPositionsBuffer);
452 if (leftSelVector.isUnfiltered()) {
453 for (uint64_t i = 0; i < leftSelVector.getSelSize(); i++) {
457 i, i, numSelectedValues, selectedPositionsBuffer);
461 for (uint64_t i = 0; i < leftSelVector.getSelSize(); i++) {
462 auto pos = leftSelVector[i];
466 pos, pos, numSelectedValues, selectedPositionsBuffer);
472 return numSelectedValues > 0;
476 template<
class LEFT_TYPE,
class RIGHT_TYPE,
class FUNC>
479 if (left.
state->isFlat() && right.
state->isFlat()) {
481 }
else if (left.
state->isFlat() && !right.
state->isFlat()) {
484 }
else if (!left.
state->isFlat() && right.
state->isFlat()) {
494 template<
class LEFT_TYPE,
class RIGHT_TYPE,
class FUNC>
497 if (left.
state->isFlat() && right.
state->isFlat()) {
500 }
else if (left.
state->isFlat() && !right.
state->isFlat()) {
502 left, right, selVector);
503 }
else if (!left.
state->isFlat() && right.
state->isFlat()) {
505 left, right, selVector);
508 left, right, selVector);
#define KU_ASSERT(condition)
Definition assert.h:19
Definition sel_vector.h:12
void setSelSize(sel_t size)
Definition sel_vector.h:48
std::span< sel_t > getMultableBuffer()
Definition sel_vector.h:40
Definition value_vector.h:20
uint8_t * getData() const
Definition value_vector.h:82
void resetAuxiliaryBuffer()
uint8_t isNull(uint32_t pos) const
Definition value_vector.h:47
bool hasNoNullsGuarantee() const
Definition value_vector.h:41
void setAllNull()
Definition value_vector.h:38
void setNull(uint32_t pos, bool isNull)
std::shared_ptr< DataChunkState > state
Definition value_vector.h:105
Definition alter_type.h:5
Definition binary_function_executor.h:60
static void operation(LEFT_TYPE &left, RIGHT_TYPE &right, RESULT_TYPE &result, common::ValueVector *leftValueVector, common::ValueVector *rightValueVector, common::ValueVector *, uint64_t, void *)
Definition binary_function_executor.h:62
Definition binary_function_executor.h:310
static void operation(LEFT_TYPE &left, RIGHT_TYPE &right, uint8_t &result, common::ValueVector *leftValueVector, common::ValueVector *rightValueVector)
Definition binary_function_executor.h:312
Definition binary_function_executor.h:302
static void operation(LEFT_TYPE &left, RIGHT_TYPE &right, uint8_t &result, common::ValueVector *, common::ValueVector *)
Definition binary_function_executor.h:304
Definition binary_function_executor.h:78
static void executeListStruct(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result)
Definition binary_function_executor.h:268
static void executeUDF(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result, void *dataPtr)
Definition binary_function_executor.h:296
static void executeComparison(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result)
Definition binary_function_executor.h:289
static void executeOnValue(common::ValueVector &left, common::ValueVector &right, common::ValueVector &resultValueVector, uint64_t lPos, uint64_t rPos, uint64_t resPos, void *dataPtr)
Definition binary_function_executor.h:81
static void executeBothUnFlat(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result, void *dataPtr)
Definition binary_function_executor.h:192
static bool select(common::ValueVector &left, common::ValueVector &right, common::SelectionVector &selVector)
Definition binary_function_executor.h:477
static void executeFlatUnFlat(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result, void *dataPtr)
Definition binary_function_executor.h:106
static void selectOnValue(common::ValueVector &left, common::ValueVector &right, uint64_t lPos, uint64_t rPos, uint64_t resPos, uint64_t &numSelectedValues, std::span< common::sel_t > selectedPositionsBuffer)
Definition binary_function_executor.h:319
static void executeListExtract(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result)
Definition binary_function_executor.h:282
static bool selectComparison(common::ValueVector &left, common::ValueVector &right, common::SelectionVector &selVector)
Definition binary_function_executor.h:495
static void executeSwitch(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result, void *dataPtr)
Definition binary_function_executor.h:233
static uint64_t selectBothFlat(common::ValueVector &left, common::ValueVector &right)
Definition binary_function_executor.h:331
static void execute(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result)
Definition binary_function_executor.h:254
static void executeBothFlat(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result, void *dataPtr)
Definition binary_function_executor.h:92
static bool selectBothUnFlat(common::ValueVector &left, common::ValueVector &right, common::SelectionVector &selVector)
Definition binary_function_executor.h:433
static bool selectFlatUnFlat(common::ValueVector &left, common::ValueVector &right, common::SelectionVector &selVector)
Definition binary_function_executor.h:344
static void executeUnFlatFlat(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result, void *dataPtr)
Definition binary_function_executor.h:149
static bool selectUnFlatFlat(common::ValueVector &left, common::ValueVector &right, common::SelectionVector &selVector)
Definition binary_function_executor.h:388
static void executeMapCreation(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result, void *dataPtr)
Definition binary_function_executor.h:275
static void executeString(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result)
Definition binary_function_executor.h:261
Definition binary_function_executor.h:13
static void operation(LEFT_TYPE &left, RIGHT_TYPE &right, RESULT_TYPE &result, common::ValueVector *, common::ValueVector *, common::ValueVector *, uint64_t, void *)
Definition binary_function_executor.h:15
Definition binary_function_executor.h:22
static void operation(LEFT_TYPE &left, RIGHT_TYPE &right, RESULT_TYPE &result, common::ValueVector *leftValueVector, common::ValueVector *rightValueVector, common::ValueVector *resultValueVector, uint64_t, void *)
Definition binary_function_executor.h:24
Definition binary_function_executor.h:31
static void operation(LEFT_TYPE &left, RIGHT_TYPE &right, RESULT_TYPE &result, common::ValueVector *leftValueVector, common::ValueVector *rightValueVector, common::ValueVector *resultValueVector, uint64_t, void *dataPtr)
Definition binary_function_executor.h:33
Definition binary_function_executor.h:51
static void operation(LEFT_TYPE &left, RIGHT_TYPE &right, RESULT_TYPE &result, common::ValueVector *, common::ValueVector *, common::ValueVector *resultValueVector, uint64_t, void *)
Definition binary_function_executor.h:53
Definition binary_function_executor.h:69
static void operation(LEFT_TYPE &left, RIGHT_TYPE &right, RESULT_TYPE &result, common::ValueVector *, common::ValueVector *, common::ValueVector *, uint64_t, void *dataPtr)
Definition binary_function_executor.h:71