| 9 | namespace function { |
| 10 | |
| 11 | static 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 | |
| 28 | static void execFunc(const std::vector<std::shared_ptr<common::ValueVector>>& params, |
| 29 | const std::vector<common::SelectionVector*>& paramSelVectors, common::ValueVector& result, |
nothing calls this directly
no test coverage detected