MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / execute

Method execute

src/function/vector_hash_functions.cpp:22–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20
21template<typename OPERAND_TYPE, typename RESULT_TYPE>
22void UnaryHashFunctionExecutor::execute(const ValueVector& operand,
23 const SelectionView& operandSelectVec, ValueVector& result,
24 const SelectionView& resultSelectVec) {
25 auto resultValues = (RESULT_TYPE*)result.getData();
26 if (operand.hasNoNullsGuarantee()) {
27 if (operandSelectVec.isUnfiltered()) {
28 for (auto i = 0u; i < operandSelectVec.getSelSize(); i++) {
29 auto resultPos = resultSelectVec[i];
30 executeOnValue<OPERAND_TYPE, RESULT_TYPE>(operand, i, result, resultPos);
31 }
32 } else {
33 for (auto i = 0u; i < operandSelectVec.getSelSize(); i++) {
34 auto operandPos = operandSelectVec[i];
35 auto resultPos = resultSelectVec[i];
36 Hash::operation(operand.getValue<OPERAND_TYPE>(operandPos),
37 resultValues[resultPos]);
38 }
39 }
40 } else {
41 if (operandSelectVec.isUnfiltered()) {
42 for (auto i = 0u; i < operandSelectVec.getSelSize(); i++) {
43 auto resultPos = resultSelectVec[i];
44 if (!operand.isNull(i)) {
45 Hash::operation(operand.getValue<OPERAND_TYPE>(i), resultValues[resultPos]);
46 } else {
47 result.setValue(resultPos, NULL_HASH);
48 }
49 }
50 } else {
51 for (auto i = 0u; i < operandSelectVec.getSelSize(); i++) {
52 auto operandPos = operandSelectVec[i];
53 auto resultPos = resultSelectVec[i];
54 if (!operand.isNull(operandPos)) {
55 Hash::operation(operand.getValue<OPERAND_TYPE>(operandPos),
56 resultValues[resultPos]);
57 } else {
58 result.setValue(resultPos, NULL_HASH);
59 }
60 }
61 }
62 }
63}
64
65template<typename LEFT_TYPE, typename RIGHT_TYPE, typename RESULT_TYPE, typename FUNC>
66static void executeOnValue(const common::ValueVector& left, common::sel_t leftPos,

Callers

nothing calls this directly

Calls 8

operationFunction · 0.85
validateSelStateFunction · 0.85
isUnfilteredMethod · 0.80
getSelSizeMethod · 0.80
getDataMethod · 0.45
isNullMethod · 0.45
setValueMethod · 0.45
resetAuxiliaryBufferMethod · 0.45

Tested by

no test coverage detected