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* aValueVector,
void* resultValueVector,
void* ) {
34 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename OP>
35 static inline void operation(A_TYPE& a, B_TYPE& b, C_TYPE& c, RESULT_TYPE& result,
36 void* ,
void* ,
void* dataPtr) {
37 OP::operation(a, b, c, result, dataPtr);
42 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
46 uint64_t cPos, uint64_t resPos,
void* dataPtr) {
47 auto resValues = (RESULT_TYPE*)result.
getData();
48 OP_WRAPPER::template operation<A_TYPE, B_TYPE, C_TYPE, RESULT_TYPE, FUNC>(
50 ((C_TYPE*)c.
getData())[cPos], resValues[resPos], (
void*)&a, (
void*)&result, dataPtr);
53 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
57 auto aPos = a.
state->getSelVector()[0];
58 auto bPos = b.
state->getSelVector()[0];
59 auto cPos = c.
state->getSelVector()[0];
60 auto resPos = result.
state->getSelVector()[0];
62 if (!result.
isNull(resPos)) {
64 aPos, bPos, cPos, resPos, dataPtr);
68 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
72 auto aPos = a.
state->getSelVector()[0];
73 auto bPos = b.
state->getSelVector()[0];
74 auto& cSelVector = c.
state->getSelVector();
78 if (cSelVector.isUnfiltered()) {
79 for (
auto i = 0u; i < cSelVector.getSelSize(); ++i) {
81 result, aPos, bPos, i, i, dataPtr);
84 for (
auto i = 0u; i < cSelVector.getSelSize(); ++i) {
85 auto pos = cSelVector[i];
87 result, aPos, bPos, pos, pos, dataPtr);
91 if (cSelVector.isUnfiltered()) {
92 for (
auto i = 0u; i < cSelVector.getSelSize(); ++i) {
96 c, result, aPos, bPos, i, i, dataPtr);
100 for (
auto i = 0u; i < cSelVector.getSelSize(); ++i) {
101 auto pos = cSelVector[i];
103 if (!result.
isNull(pos)) {
105 c, result, aPos, bPos, pos, pos, dataPtr);
112 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
117 auto aPos = a.
state->getSelVector()[0];
118 auto& bSelVector = b.
state->getSelVector();
122 if (bSelVector.isUnfiltered()) {
123 for (
auto i = 0u; i < bSelVector.getSelSize(); ++i) {
125 result, aPos, i, i, i, dataPtr);
128 for (
auto i = 0u; i < bSelVector.getSelSize(); ++i) {
129 auto pos = bSelVector[i];
131 result, aPos, pos, pos, pos, dataPtr);
135 if (bSelVector.isUnfiltered()) {
136 for (
auto i = 0u; i < bSelVector.getSelSize(); ++i) {
140 c, result, aPos, i, i, i, dataPtr);
144 for (
auto i = 0u; i < bSelVector.getSelSize(); ++i) {
145 auto pos = bSelVector[i];
147 if (!result.
isNull(pos)) {
149 c, result, aPos, pos, pos, pos, dataPtr);
156 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
160 auto aPos = a.
state->getSelVector()[0];
161 auto cPos = c.
state->getSelVector()[0];
162 auto& bSelVector = b.
state->getSelVector();
166 if (bSelVector.isUnfiltered()) {
167 for (
auto i = 0u; i < bSelVector.getSelSize(); ++i) {
169 result, aPos, i, cPos, i, dataPtr);
172 for (
auto i = 0u; i < bSelVector.getSelSize(); ++i) {
173 auto pos = bSelVector[i];
175 result, aPos, pos, cPos, pos, dataPtr);
179 if (bSelVector.isUnfiltered()) {
180 for (
auto i = 0u; i < bSelVector.getSelSize(); ++i) {
184 c, result, aPos, i, cPos, i, dataPtr);
188 for (
auto i = 0u; i < bSelVector.getSelSize(); ++i) {
189 auto pos = bSelVector[i];
191 if (!result.
isNull(pos)) {
193 c, result, aPos, pos, cPos, pos, dataPtr);
200 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
205 auto& aSelVector = a.
state->getSelVector();
207 if (aSelVector.isUnfiltered()) {
208 for (uint64_t i = 0; i < aSelVector.getSelSize(); i++) {
210 result, i, i, i, i, dataPtr);
213 for (uint64_t i = 0; i < aSelVector.getSelSize(); i++) {
214 auto pos = aSelVector[i];
216 result, pos, pos, pos, pos, dataPtr);
220 if (aSelVector.isUnfiltered()) {
221 for (uint64_t i = 0; i < aSelVector.getSelSize(); i++) {
225 c, result, i, i, i, i, dataPtr);
229 for (uint64_t i = 0; i < aSelVector.getSelSize(); i++) {
230 auto pos = aSelVector[i];
232 if (!result.
isNull(pos)) {
234 c, result, pos, pos, pos, pos, dataPtr);
241 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
245 auto bPos = b.
state->getSelVector()[0];
246 auto cPos = c.
state->getSelVector()[0];
247 auto& aSelVector = a.
state->getSelVector();
251 if (aSelVector.isUnfiltered()) {
252 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
254 result, i, bPos, cPos, i, dataPtr);
257 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
258 auto pos = aSelVector[i];
260 result, pos, bPos, cPos, pos, dataPtr);
264 if (aSelVector.isUnfiltered()) {
265 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
269 c, result, i, bPos, cPos, i, dataPtr);
273 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
274 auto pos = aSelVector[i];
276 if (!result.
isNull(pos)) {
278 c, result, pos, bPos, cPos, pos, dataPtr);
285 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
290 auto& aSelVector = a.
state->getSelVector();
291 auto bPos = b.
state->getSelVector()[0];
295 if (aSelVector.isUnfiltered()) {
296 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
298 result, i, bPos, i, i, dataPtr);
301 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
302 auto pos = aSelVector[i];
304 result, pos, bPos, pos, pos, dataPtr);
308 if (aSelVector.isUnfiltered()) {
309 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
313 c, result, i, bPos, i, i, dataPtr);
317 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
318 auto pos = b.
state->getSelVector()[i];
320 if (!result.
isNull(pos)) {
322 c, result, pos, bPos, pos, pos, dataPtr);
329 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
334 auto& aSelVector = a.
state->getSelVector();
335 auto cPos = c.
state->getSelVector()[0];
339 if (aSelVector.isUnfiltered()) {
340 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
342 result, i, i, cPos, i, dataPtr);
345 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
346 auto pos = aSelVector[i];
348 result, pos, pos, cPos, pos, dataPtr);
352 if (aSelVector.isUnfiltered()) {
353 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
357 c, result, i, i, cPos, i, dataPtr);
361 for (
auto i = 0u; i < aSelVector.getSelSize(); ++i) {
362 auto pos = aSelVector[i];
364 if (!result.
isNull(pos)) {
366 c, result, pos, pos, cPos, pos, dataPtr);
373 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC,
381 }
else if (a.
state->isFlat() && b.
state->isFlat() && !c.
state->isFlat()) {
384 }
else if (a.
state->isFlat() && !b.
state->isFlat() && !c.
state->isFlat()) {
387 }
else if (a.
state->isFlat() && !b.
state->isFlat() && c.
state->isFlat()) {
390 }
else if (!a.
state->isFlat() && !b.
state->isFlat() && !c.
state->isFlat()) {
393 }
else if (!a.
state->isFlat() && !b.
state->isFlat() && c.
state->isFlat()) {
396 }
else if (!a.
state->isFlat() && b.
state->isFlat() && c.
state->isFlat()) {
399 }
else if (!a.
state->isFlat() && b.
state->isFlat() && !c.
state->isFlat()) {
407 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC>
414 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC>
418 c, result,
nullptr );
421 template<
typename A_TYPE,
typename B_TYPE,
typename C_TYPE,
typename RESULT_TYPE,
typename FUNC>
425 c, result,
nullptr );
428 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: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 ternary_function_executor.h:41
static void executeAllUnFlat(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:202
static void executeSwitch(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:375
static void executeString(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result)
Definition ternary_function_executor.h:415
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:44
static void executeFlatFlatUnflat(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:70
static void executeListStruct(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result)
Definition ternary_function_executor.h:422
static void executeUnflatFlatFlat(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:243
static void executeUDF(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:429
static void execute(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result)
Definition ternary_function_executor.h:408
static void executeFlatUnflatFlat(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:158
static void executeAllFlat(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:55
static void executeUnflatUnFlatFlat(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:331
static void executeUnflatFlatUnflat(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:287
static void executeFlatUnflatUnflat(common::ValueVector &a, common::ValueVector &b, common::ValueVector &c, common::ValueVector &result, void *dataPtr)
Definition ternary_function_executor.h:114
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:24
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: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:33
static void operation(A_TYPE &a, B_TYPE &b, C_TYPE &c, RESULT_TYPE &result, void *, void *, void *dataPtr)
Definition ternary_function_executor.h:35