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

Function bindFunc

src/function/list/list_slice_function.cpp:56–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54};
55
56static std::unique_ptr<FunctionBindData> bindFunc(const ScalarBindFuncInput& input) {
57 DASSERT(input.arguments.size() == 3);
58 std::vector<LogicalType> paramTypes;
59 auto& arg0Type = input.arguments[0]->getDataType();
60 LogicalType resultType;
61 switch (arg0Type.getLogicalTypeID()) {
62 case LogicalTypeID::ANY: {
63 paramTypes.push_back(LogicalType::STRING());
64 resultType = LogicalType::STRING();
65 } break;
66 case LogicalTypeID::ARRAY: {
67 paramTypes.push_back(arg0Type.copy());
68 resultType = LogicalType::LIST(ArrayType::getChildType(arg0Type).copy());
69 } break;
70 default: {
71 paramTypes.push_back(arg0Type.copy());
72 resultType = arg0Type.copy();
73 }
74 }
75 paramTypes.push_back(LogicalType(input.definition->parameterTypeIDs[1]));
76 paramTypes.push_back(LogicalType(input.definition->parameterTypeIDs[2]));
77 return std::make_unique<FunctionBindData>(std::move(paramTypes), std::move(resultType));
78}
79
80function_set ListSliceFunction::getFunctionSet() {
81 function_set result;

Callers

nothing calls this directly

Calls 7

getChildTypeFunction · 0.85
getDataTypeMethod · 0.80
getLogicalTypeIDMethod · 0.80
LogicalTypeClass · 0.50
sizeMethod · 0.45
push_backMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected