| 8 | using namespace lbug::common; |
| 9 | |
| 10 | static std::unique_ptr<FunctionBindData> bindFunc(const ScalarBindFuncInput& input) { |
| 11 | if (input.arguments.size() < 2) { |
| 12 | throw BinderException{std::format("concat_ws expects at least two parameters. Got: {}.", |
| 13 | input.arguments.size())}; |
| 14 | } |
| 15 | for (auto i = 0u; i < input.arguments.size(); i++) { |
| 16 | auto& argument = input.arguments[i]; |
| 17 | if (argument->getDataType().getLogicalTypeID() == LogicalTypeID::ANY) { |
| 18 | argument->cast(LogicalType::STRING()); |
| 19 | } |
| 20 | if (argument->getDataType() != LogicalType::STRING()) { |
| 21 | throw BinderException{std::format("concat_ws expects all string parameters. Got: {}.", |
| 22 | argument->getDataType().toString())}; |
| 23 | } |
| 24 | } |
| 25 | return FunctionBindData::getSimpleBindData(input.arguments, LogicalType::STRING()); |
| 26 | } |
| 27 | |
| 28 | using handle_separator_func_t = std::function<void()>; |
| 29 | using handle_element_func_t = std::function<void(const string_t&)>; |
nothing calls this directly
no test coverage detected