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

Function bindFunc

src/function/utility/coalesce.cpp:11–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9namespace function {
10
11static std::unique_ptr<FunctionBindData> bindFunc(const ScalarBindFuncInput& input) {
12 if (input.arguments.empty()) {
13 throw BinderException("COALESCE requires at least one argument");
14 }
15 LogicalType resultType(LogicalTypeID::ANY);
16 binder::ExpressionUtil::tryCombineDataType(input.arguments, resultType);
17 if (resultType.getLogicalTypeID() == LogicalTypeID::ANY) {
18 resultType = LogicalType::STRING();
19 }
20 auto bindData = std::make_unique<FunctionBindData>(resultType.copy());
21 for (auto& _ : input.arguments) {
22 (void)_;
23 bindData->paramTypes.push_back(resultType.copy());
24 }
25 return bindData;
26}
27
28static void execFunc(const std::vector<std::shared_ptr<common::ValueVector>>& params,
29 const std::vector<common::SelectionVector*>& paramSelVectors, common::ValueVector& result,

Callers

nothing calls this directly

Calls 4

getLogicalTypeIDMethod · 0.80
emptyMethod · 0.45
copyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected