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

Function validateArrayFunctionParameters

src/function/array/array_functions.cpp:114–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114static LogicalType validateArrayFunctionParameters(const LogicalType& leftType,
115 const LogicalType& rightType, const std::string& functionName) {
116 auto leftChildType = getChildType(leftType);
117 auto rightChildType = getChildType(rightType);
118 validateChildType(leftChildType, functionName);
119 validateChildType(rightChildType, functionName);
120 if (leftType.getLogicalTypeID() == common::LogicalTypeID::ARRAY) {
121 return leftType.copy();
122 } else if (rightType.getLogicalTypeID() == common::LogicalTypeID::ARRAY) {
123 return rightType.copy();
124 }
125 throw BinderException(
126 std::format("{} requires at least one argument to be ARRAY but all parameters are LIST.",
127 functionName));
128}
129
130template<typename OPERATION, typename RESULT>
131static scalar_func_exec_t getBinaryArrayExecFuncSwitchResultType() {

Callers 1

arrayTemplateBindFuncFunction · 0.85

Calls 4

getChildTypeFunction · 0.85
validateChildTypeFunction · 0.85
getLogicalTypeIDMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected