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();
114 rightSelVector.forEach([&](
auto i) {
116 result, lPos, i, i, dataPtr);
119 rightSelVector.forEach([&](
auto i) {
123 right, result, lPos, i, i, dataPtr);
129 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC,
133 auto rPos = right.
state->getSelVector()[0];
134 auto& leftSelVector = left.
state->getSelVector();
139 leftSelVector.forEach([&](
auto i) {
141 result, i, rPos, i, dataPtr);
144 leftSelVector.forEach([&](
auto i) {
148 right, result, i, rPos, i, dataPtr);
154 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC,
159 auto& resultSelVector = result.
state->getSelVector();
162 resultSelVector.forEach([&](
auto i) {
164 result, i, i, i, dataPtr);
167 resultSelVector.forEach([&](
auto i) {
171 right, result, i, i, i, dataPtr);
177 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC,
182 if (left.
state->isFlat() && right.
state->isFlat()) {
185 }
else if (left.
state->isFlat() && !right.
state->isFlat()) {
188 }
else if (!left.
state->isFlat() && right.
state->isFlat()) {
191 }
else if (!left.
state->isFlat() && !right.
state->isFlat()) {
199 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC>
206 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC>
210 right, result,
nullptr );
213 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC>
217 left, right, result,
nullptr );
220 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC>
224 left, right, result, dataPtr);
227 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC>
231 left, right, result,
nullptr );
234 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC>
238 left, right, result,
nullptr );
241 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename RESULT_TYPE,
typename FUNC>
245 right, result, dataPtr);
249 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename OP>
250 static inline void operation(LEFT_TYPE& left, RIGHT_TYPE& right, uint8_t& result,
252 OP::operation(left, right, result);
257 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename OP>
258 static inline void operation(LEFT_TYPE& left, RIGHT_TYPE& right, uint8_t& result,
260 OP::operation(left, right, result, leftValueVector, rightValueVector);
264 template<
class LEFT_TYPE,
class RIGHT_TYPE,
class FUNC,
typename SELECT_WRAPPER>
266 uint64_t rPos, uint64_t resPos, uint64_t& numSelectedValues,
267 std::span<common::sel_t> selectedPositionsBuffer) {
268 uint8_t resultValue = 0;
269 SELECT_WRAPPER::template operation<LEFT_TYPE, RIGHT_TYPE, FUNC>(
270 ((LEFT_TYPE*)left.
getData())[lPos], ((RIGHT_TYPE*)right.
getData())[rPos], resultValue,
272 selectedPositionsBuffer[numSelectedValues] = resPos;
273 numSelectedValues += (resultValue ==
true);
276 template<
class LEFT_TYPE,
class RIGHT_TYPE,
class FUNC,
typename SELECT_WRAPPER>
278 auto lPos = left.
state->getSelVector()[0];
279 auto rPos = right.
state->getSelVector()[0];
280 uint8_t resultValue = 0;
282 SELECT_WRAPPER::template operation<LEFT_TYPE, RIGHT_TYPE, FUNC>(
283 ((LEFT_TYPE*)left.
getData())[lPos], ((RIGHT_TYPE*)right.
getData())[rPos],
284 resultValue, &left, &right);
286 return resultValue ==
true;
289 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename FUNC,
typename SELECT_WRAPPER>
292 auto lPos = left.
state->getSelVector()[0];
293 uint64_t numSelectedValues = 0;
295 auto& rightSelVector = right.
state->getSelVector();
297 return numSelectedValues;
299 rightSelVector.forEach([&](
auto i) {
301 numSelectedValues, selectedPositionsBuffer);
304 rightSelVector.forEach([&](
auto i) {
307 i, numSelectedValues, selectedPositionsBuffer);
312 return numSelectedValues > 0;
315 template<
typename LEFT_TYPE,
typename RIGHT_TYPE,
typename FUNC,
typename SELECT_WRAPPER>
318 auto rPos = right.
state->getSelVector()[0];
319 uint64_t numSelectedValues = 0;
321 auto& leftSelVector = left.
state->getSelVector();
323 return numSelectedValues;
325 leftSelVector.forEach([&](
auto i) {
327 numSelectedValues, selectedPositionsBuffer);
330 leftSelVector.forEach([&](
auto i) {
333 i, numSelectedValues, selectedPositionsBuffer);
338 return numSelectedValues > 0;
342 template<
class LEFT_TYPE,
class RIGHT_TYPE,
class FUNC,
typename SELECT_WRAPPER>
345 uint64_t numSelectedValues = 0;
347 auto& leftSelVector = left.
state->getSelVector();
349 leftSelVector.forEach([&](
auto i) {
351 numSelectedValues, selectedPositionsBuffer);
354 leftSelVector.forEach([&](
auto i) {
358 numSelectedValues, selectedPositionsBuffer);
363 return numSelectedValues > 0;
367 template<
class LEFT_TYPE,
class RIGHT_TYPE,
class FUNC>
370 if (left.
state->isFlat() && right.
state->isFlat()) {
372 }
else if (left.
state->isFlat() && !right.
state->isFlat()) {
375 }
else if (!left.
state->isFlat() && right.
state->isFlat()) {
385 template<
class LEFT_TYPE,
class RIGHT_TYPE,
class FUNC>
388 if (left.
state->isFlat() && right.
state->isFlat()) {
391 }
else if (left.
state->isFlat() && !right.
state->isFlat()) {
393 left, right, selVector);
394 }
else if (!left.
state->isFlat() && right.
state->isFlat()) {
396 left, right, selVector);
399 left, right, selVector);
#define KU_ASSERT(condition)
Definition assert.h:19
Definition sel_vector.h:12
std::span< sel_t > getMutableBuffer() const
Definition sel_vector.h:47
void setSelSize(sel_t size)
Definition sel_vector.h:69
Definition value_vector.h:20
uint8_t * getData() const
Definition value_vector.h:83
void resetAuxiliaryBuffer()
void setAllNonNull()
Definition value_vector.h:40
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 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:256
static void operation(LEFT_TYPE &left, RIGHT_TYPE &right, uint8_t &result, common::ValueVector *leftValueVector, common::ValueVector *rightValueVector)
Definition binary_function_executor.h:258
Definition binary_function_executor.h:248
static void operation(LEFT_TYPE &left, RIGHT_TYPE &right, uint8_t &result, common::ValueVector *, common::ValueVector *)
Definition binary_function_executor.h:250
Definition binary_function_executor.h:78
static void executeListStruct(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result)
Definition binary_function_executor.h:214
static void executeUDF(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result, void *dataPtr)
Definition binary_function_executor.h:242
static void executeComparison(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result)
Definition binary_function_executor.h:235
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:156
static bool select(common::ValueVector &left, common::ValueVector &right, common::SelectionVector &selVector)
Definition binary_function_executor.h:368
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:265
static void executeListExtract(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result)
Definition binary_function_executor.h:228
static bool selectComparison(common::ValueVector &left, common::ValueVector &right, common::SelectionVector &selVector)
Definition binary_function_executor.h:386
static void executeSwitch(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result, void *dataPtr)
Definition binary_function_executor.h:179
static uint64_t selectBothFlat(common::ValueVector &left, common::ValueVector &right)
Definition binary_function_executor.h:277
static void execute(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result)
Definition binary_function_executor.h:200
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:343
static bool selectFlatUnFlat(common::ValueVector &left, common::ValueVector &right, common::SelectionVector &selVector)
Definition binary_function_executor.h:290
static void executeUnFlatFlat(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result, void *dataPtr)
Definition binary_function_executor.h:131
static bool selectUnFlatFlat(common::ValueVector &left, common::ValueVector &right, common::SelectionVector &selVector)
Definition binary_function_executor.h:316
static void executeMapCreation(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result, void *dataPtr)
Definition binary_function_executor.h:221
static void executeString(common::ValueVector &left, common::ValueVector &right, common::ValueVector &result)
Definition binary_function_executor.h:207
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