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

Function execFunc

src/function/utility/constant_or_null.cpp:23–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23static void execFunc(const std::vector<std::shared_ptr<common::ValueVector>>& params,
24 const std::vector<common::SelectionVector*>& paramSelVectors, common::ValueVector& result,
25 common::SelectionVector* resultSelVector, void* /*dataPtr*/) {
26 DASSERT(params.size() == 2);
27 result.resetAuxiliaryBuffer();
28 for (auto i = 0u; i < resultSelVector->getSelSize(); ++i) {
29 auto resultPos = (*resultSelVector)[i];
30 auto firstParamPos = params[0]->state->isFlat() ? (*paramSelVectors[0])[0] : resultPos;
31 auto secondParamPos = params[1]->state->isFlat() ? (*paramSelVectors[1])[0] : resultPos;
32 if (params[1]->isNull(secondParamPos) || params[0]->isNull(firstParamPos)) {
33 result.setNull(resultPos, true);
34 } else {
35 result.setNull(resultPos, false);
36 result.copyFromVectorData(resultPos, params[0].get(), firstParamPos);
37 }
38 }
39}
40
41static bool selectFunc(const std::vector<std::shared_ptr<ValueVector>>& params,
42 SelectionVector& selVector, void* /* dataPtr */) {

Callers

nothing calls this directly

Calls 8

getSelSizeMethod · 0.80
copyFromVectorDataMethod · 0.80
sizeMethod · 0.45
resetAuxiliaryBufferMethod · 0.45
isFlatMethod · 0.45
isNullMethod · 0.45
setNullMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected