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

Method operation

src/function/list/list_to_string_function.cpp:16–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14};
15
16void ListToString::operation(string_t& delim, list_entry_t& input, string_t& result,
17 ValueVector& /*delimVector*/, ValueVector& inputVector, ValueVector& resultVector) {
18 std::string resultStr = "";
19 bool outputDelim = false;
20 if (input.size != 0) {
21 auto dataVector = ListVector::getDataVector(&inputVector);
22 if (!dataVector->isNull(input.offset)) {
23 resultStr += TypeUtils::entryToString(dataVector->dataType,
24 ListVector::getListValuesWithOffset(&inputVector, input, 0 /* offset */),
25 dataVector);
26 outputDelim = true;
27 }
28 for (auto i = 1u; i < input.size; i++) {
29 if (dataVector->isNull(input.offset + i)) {
30 continue;
31 }
32 if (outputDelim) {
33 resultStr += delim.getAsString();
34 }
35 outputDelim = true;
36 resultStr += TypeUtils::entryToString(dataVector->dataType,
37 ListVector::getListValuesWithOffset(&inputVector, input, i), dataVector);
38 }
39 }
40 StringVector::addString(&resultVector, result, resultStr);
41}
42
43static std::unique_ptr<FunctionBindData> bindFunc(const ScalarBindFuncInput& input) {
44 std::vector<LogicalType> paramTypes;

Callers

nothing calls this directly

Calls 4

getListValuesWithOffsetFunction · 0.85
getAsStringMethod · 0.80
getDataVectorFunction · 0.50
isNullMethod · 0.45

Tested by

no test coverage detected