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

Method operation

src/function/string/split_part.cpp:10–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8
9struct SplitPart {
10 static void operation(string_t& strToSplit, string_t& separator, int64_t idx, string_t& result,
11 ValueVector& resultVector) {
12 auto splitStrVec = StringUtils::split(strToSplit.getAsString(), separator.getAsString());
13 bool idxOutOfRange = idx <= 0 || (uint64_t)idx > splitStrVec.size();
14 std::string resultStr = idxOutOfRange ? "" : splitStrVec[idx - 1];
15 StringVector::addString(&resultVector, result, resultStr);
16 }
17};
18
19static std::unique_ptr<FunctionBindData> bindFunc(const ScalarBindFuncInput& input) {

Callers

nothing calls this directly

Calls 2

getAsStringMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected